Hey Gaetano S.
The `createListQueryBuilder` is not a Doctrine method, it's a EasyAdmin method which creates the query builder for the "List" view. I believe the new name for that method is `createIndexQueryBuilder()`
Cheers! ...
... What's the default value of query_cache_driver, and is it better/faster to set it to apcu or redis ! By default, does doctrine set the result of repository queries under cache ?
Hello, I think that you have a typo here
// src/Yoda/EventBundle/Entity/Event.php
// ...
use Doctrine\Common\Collections\ArrayCollection;
public function __construct()
{
$this->events = new ArrayCollection();
}
----------------------------
$this->attendees = new ArrayCollection(); is the correct right? ...
Just for reference, I talked to MolloKhan on a different thread and (actually) he solved his own issue. The answer was basically storing things in the session or using Doctrine cache (to avoid queries on each page) :) ...
Yes, you *should* get an error - I got one too :). I talk about it here: https://knpuniversity.com/screencast/doctrine-relations/join-column-relation-fixtures#when-migrations-go-wrong
Cheers! ...
Hey Joe L.
We added the `TimestampableEntity` trait to the Comment class in the first video, you may have lost it but here it is :)
https://symfonycasts.com/screencast/doctrine-relations/comment-entity?playAt=237
Cheers! ...
Hello,
I guess I installed mySQL now I'm getting a different error
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
some help anyone please :)
thank you ...
Hey Nathan
Looks like you got outdated code, can you re-download it and try again? if you will get same notice again, than share please your php and `doctrine/orm` versions
Cheers! ...
acually I DO SEE!
vendor/symfony/messenger/Transport/Doctrine/Connection.php:line 281
```
private function createAvailableMessagesQueryBuilder(): QueryBuilder
{
$now = new \DateTime ...
Hey Amit!
Thanks for the note! I know this error - it IS indeed a problem with an older version of doctrine/annotations. We'll see if we can upgrade it in the course code :).
Cheers! ...
Solution:
I found out, that doctrine really has nothing to offer for this use case.
I have to filter all "operator" characters on $searchTerm myself.
I do this with:
```
$searchTerm = '*' . preg_replace('/[+\-> ...
Hey Ed,
You might be interested to look at implementation of Paginator in Symfony Demo that is based on Doctrine paginator :)
https://github.com/symfony/demo/blob/d94fcc81f81a72760a4ed759579afaf727d538f2/src/Pagination/Paginator.php
Cheers! ...
actually what I did was install the Doctrine Test Bundle and it also refreshes the db after every test. Found here https://symfony.com/doc/current/testing/database.html#resetting-the-database-automatically-before-each-test ...
Hey Dung L.
You only have to tweak your ORM config. It should use the "underscore" naming strategy instead of camel case.
```
// config/packages/doctrine.yaml
doctrine:
orm:
naming_strategy: doctrine.orm.naming_strategy.underscore
```
Cheers! ...
For those who struggling filtering collection of entities with @Embedded ones. AFAIK it's not possible to apply Criteria API to the property of @Embedded entity. You can be saved with \Doctrine\Common\Collections\ArrayCollection::filter method ...
Hey Mark
Have you take a look to this? https://symfony.com/doc/current/doctrine/pdo_session_storage.html
Seems like you just need to tell Symfony to write the session into the DB instead of a file
Cheers! ...
... class "MySqlPlatform" from namespace "Doctrine\DBAL\Platforms".
Did you forget a "use" statement for another namespace?
Can someone help me?
Hello there,
When building a project from scratch, what is a preferred way - to design and create database first then generate entity classes (https://symfony.com/doc/current/doctrine/reverse_engineering.html) or create entity first then migrate it into database?
Thank you! ...
I kind of agree if you use an ORM like Doctrine but still you can be coding some vulnerable code. Like for example, not escaping variables coming from user input.
cheers! ...
... Hi Guys, I'm getting an error when trying to run this - PHP Fatal error: During class fetch: Uncaught ReflectionException: Class Symfony\Component\Form\FormTypeGuesserInterface not found in /vendor/symfony/doctrine-bridge/Form/DoctrineOrmTypeGuesser.php:25. Can anyone provide some help?
2709
Doctrine
Filter Results