Gey Gustavo,
I'm not sure Doctrine has such annotation :) How will Doctrine know to whom assign it? It's only possible to set genus to NULL on deleting. I *think* you can add a listener to listen to preRemove event and implement a custom…
…4.1 and found the doctrine:migrations:generate and diff commands just created migrations with VOID inside (ie there was no SQL), so then running migrate would create/update the migration version table but not create the users table. However running doctrine:schema:update --force…
…the Doctrine\Common\ClassLoader somewhere in your project? Probably not, I think it's just used somewhere internally. If so - you don't need to do any actions, you just need to wait for updates and upgrade your dependencies. But if you use doctrine/common…
When i call php ./bin/console doctrine:fixtures:load
I get an error
Call to a member function text() on null
I need to create some Doctrine Entities in my bundle, to be used by the external App. How can I add and configure these Entities?
Do you think we should also inject Doctrine in the controller with `RegistryInterface $doctrine` instead of $this->getDoctrine()?
This is my last question hehe, great course btw
Hey Trafficmanagertech
Usually you don't need Doctrine itself, what you usually need is a repository or the entity manager, but if for some reason you need it, I believe you can inject it directly to a controller's action
Cheers!
In my app I am using Doctrine Blameable Extension, so it sets the current user when creating a post on the createdBy field.
How can I handle this when running my tests?
Hi,
When i attempt ./app/console doctrine:schema:create I receive this error [Doctrine\Common\Annotations\AnnotationException]
[Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_PARENTHESIS, got
'length' at position 26 in property AppBundle\Entity\Movie::$samsCharacterName.
doctrine:schema:create [--dump-sql] [--em [EM…
As soon as I switched to Doctrine's Criteria system I started getting this error:
```
An exception has been thrown during the rendering of a template ("Notice: Undefined property: AppBundle\Entity\GenusScientist::$1") in
genus/list.html.twig at line 20.
```
Hey Nina,
Have you imported namespace "use Doctrine\ORM\Mapping as ORM;" before GenusScientist class declaration? If so, could you show us your GenusScientist::$genus property definition with its annotations?
Cheers!
Hi,guys
after load bin/console doctrine:fixtures:load
unexpectedvalueexception could not determine how to assign createAt to a AppBundle\Entity\GenusNote object
While I enjoyed learning about the Doctrine listener, it seems like a lot of extra work to put in the Doctrine listener to encode the password. Why not just encode the password whenever setPassword() is called? Something like the following?
User Entity:
```
public function setPassword…
Why don't you use doctrine:generate:entities instead of Phpstorm autocompletion?
I have already run bin/console doctrine:migrations:migrate and it is all ok. The problem appears when i try to load fixture to recover the fake data.
Cheers!
Hello as I launch the ./bin/console doctrine:database:create I get this error :"[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] Connection refused
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
"
Can someone…
Do you need getters and setters for Doctrine/Symfony to work? Or can you just make the Entity properties public?
Also... along the same lines... why even use getters and setters? I've read that its so that you can later add further functionality to…
…bin/console doctrine:schema:update --dump-sql without getting an error: Compile Error: Cannot use Doctrine\ORM\Mapping as ORM because the name is already in use
This is because I am using the following
use Doctrine\ORM\Mapping\Column as ORM;
use Doctrine\ORM…
Hi everybody,
I have a question about Doctrine : if, i have to connect to an existing database, with tables and foreign keys, will
Doctrine still be okay to do that ?
Thanks
Hey Juan Nicolás
An entity in Doctrine represents a record in a table for your DB, so that's why you see a lot of DB metadata, such as relationships, field types, etc. Most of the time they have pure data, but you can put…
x
1000+