When I try to use the "Symfony\Bridge\Doctrine\Form\Type\EntityType" namespace, it says that the class does not exist and I'm using Symfony 6.2. Is there a way to start using EntityType fields in Symfony 6.2 forms? ...
Hey JnahDev,
Super-secret for now, but we're working on "Go Pro with Doctrine Queries" with the latest Symfony version :) It should be started releasing in a month or so
Cheers! ...
I fixed this bug by adding annotations.yaml in config/routes, but I don't understand why this problem occurs.
```yaml
controllers:
resource: ../../src/Controller/
type: annotation
kernel:
resource: ../../src/Kernel.php
type: annotation
```
After I installed Doctrine bundle I encountered this bug. ...
namespace AppBundle\Entiry;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="posts")
*/
class Posts {
/**
* @ORM\Id
* @ORM\GeneratedValue(stratergy="AUTO")
* @ORM\Column(type="interger")
*/
private $id;
/**
* @ORM\Column(type="string")
*/
private $name; ...
Hey Jakub,
Yea, for some reason, you got a newer Doctrine version in your project, perhaps because you were on PHP 8? If you run into a non-sense error, try reinstalling your vendors directory.
Cheers! ...
Hi,
Yeah, the doctrine will cover you with parameters so it is safe just pass it to `->setParameter()`. I can't describee how exactly it works internally, Doctrinie code is not so cool to explore
Cheers ...
Hi when following along, git status doesn't work because of course there is no git repo... I'm thinking we should run git init after composer install and before composer require "doctrine:^2.2" ...
Hey Rufnex,
Yep, exactly like Ruslan mentioned below in https://symfonycasts.com/screencast/symfony-doctrine/foundry#comment-27727
I.e. you create a faker instance manually via `$faker = Factory::create('fr_FR');` passing the desired locale and then use it below.
Cheers! ...
Glad to hear it.
I'm in progress learning the `Doctrine, Symfony 6 & the Database` course and getting better and better at understanding how to work with symfony.
You all SFCASTS team are rock! ...
Yea, it would feel nicer to get rid of all deprecations, but in this case, I think it would be better to just wait until you upgrade Doctrine
Cheers! ...
...
```
// 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 ...
2726
Doctrine
Filter Results