...
```
// doctrine.yaml
doctrine:
orm:
...
mappings:
App:
type: annotation
...
```
Hey Bernard A.
I believe you just forgot to initialize your database. You can rely on Doctrine commands to do so.
```
symfony console doctrine:database:create
symfony console doctrine:schema:create
symfony console doctrine:fixtures:load
```
Cheers! ...
Hey Mepcuk
Doctrine does not impose you any style. If you want your entities to behave as anemic or rich domain model it's up to you and the needs of your application.
Cheers! ...
This may be a little pedantic, but: I don't think your controller's `edit` method needs to say `$em->persist($article)`, does it? Doctrine already knows we want to persist, yes? ...
Thanks! Actually, totally custom classes is also what Kévin suggested. But I just don't feel like willing to lose all the perks that come with Doctrine-based resources (yet), such as pagination. ...
Hi Ryan
I did the docker-compose up -d and started the symfony webserver symfony serve -d. When I go to localhost:8000 i am getting
Doctrine\DBAL\Driver\PDO\Exception
SQLSTATE[HY000] [1049] Unknown database 'root' ...
Hey @Trainee,
Yeah that's an annoying issue and that was already discussed here. Check this thread https://symfonycasts.com/screencast/symfony-doctrine/console#comment-5045615493 for the solution! I hope that will help!
Cheers! ...
Finally this makes sense. I've been wondering about this process from soup to nuts ever since way back when Ryan gave a very brief description about this in a previous Doctrine tutorial. Thanks! ...
Thank you for amazing tutorial! You are perfect there !
Q: Where is link to Doctrine part 1? Or it is mean Symfony 4 course?
P.s. Something happend with your voice, too tired or after Covid.... ...
Looking forward to it! These doctrine courses are the reason I got a subscription. I'm currently working on a massive warehouse management database and my implementation of foundry for testing is incredibly hacky ...
Hey @Antsen
There are Doctrine extensions that allows you to create translatable entities also some bundles which helps organising it. Unfortunately can't advice any guidance or best practice yet.
Cheers ...
Hey Sherri,
Yeah, the latest v1.6.0 of the bundle requires Symfony 5.2, but you can install the previous one v1.5.0 instead that fits for ^5.0. You can do it:
$ composer require "stof/doctrine-extensions-bundle:^1.5.0"
Cheers! ...
Hey Quntun El Andaluz Trtinoh
That IS a good question and BTW doctrine extensions has a mechanism for it. Try to use SoftDeleteable behavior, you can find docs here and I think a good example here
Cheers! ...
The extension bundle should take care of it. It works via Doctrine listeners. The problem is the `other` connection configuration is just an example, you should put it on the "default" one (unless you're using multiple databases)
Cheers! ...
I believe you forgot to enable the doctrine extension. Here you can see how to do it https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/configuration.html#activate-the-extensions-you-want ...
... If you get "[Doctrine\DBAL\Exception\DriverException] An exception occurred in driver: could not find driver", simply uncomment extension=pdo_sqlite in php.ini in your php installation folder (by deleting ";"). ...
And what about https://www.doctrine-project.org/projects/doctrine-orm/en/2.8/tutorials/pagination.html
I think this tutorial have to be updated with provided reference because it out of date. ...
Hey Farry7
How are you rendering the template? Remember that you need to pass in the `$questions` variable just like in this code block https://symfonycasts.com/screencast/symfony-doctrine/more-queries#codeblock-9226231640
Cheers! ...
... There's a situation where a Doctrine event on PrePersist might not work with GraphQL? The data persister isn't triggered by my fixtures for my tests so, here's another difference I guess.
Hey there ,
Doctrine encourage to take over and control transaction demarcation ourself! So how to deal with it? Can you tell me a "good" use-case when to you use it?
Big thanks! ...
2709
Doctrine
Filter Results