Hi, I have tried to create de SubFamily Entity manually and a got this when I try bin/console doctrine:fixtures:load.
My error:
[Doctrine\ORM\ORMInvalidArgumentException]
Expected value of ...
This is weird indeed, makes me wonder a few fundamental things
Did you update the DataBase schema ? $ php bin/console doctrine:schema:update --force
Did you change anything about how Doctrine reads Entity metadata ...
Awesome :). The thumnbnailFile property in your entity will NOT be persisted to Doctrine. So, it will just be a normal property with NO @ORM\Column annotation. It exists *only* to help you work with your form. It's kind of an annoying detail, but that's how it should work.
Cheers! ...
Hey Jost!
Hahaha, don't worry, this time is much easier, you have a tiny problem, your method is called "getGenusScientists" with an "S" at the end, and Doctrine is expecting it without an "s", is a small problem for plural words, just remove the "s" and everything will work just fine
Cheers! ...
Hey Richard ,
Take a look at my comment here: https://knpuniversity.com/screencast/collections/clean-url-slugs#comment-3432539079
The main idea is do not use Doctrine migrations for such a big and complex tasks like populating slugs in production where you have a lot of entities. Use one-time Symfony commands for it.
Cheers! ...
Hey Dennis E.!
Can you show me the error message ?
I believe you just need to change your "setParameter", instead of passing the categoryId, just pass the whole object, if your relationship is correctly setup, Doctrine already knows what to do.
Have a nice day :) ...
Hi guys!!! I have the same problem as argy_13. But when I try to fix this problem (1 - composer require --dev phpdocumentor/phpdocumentor or 2 - composer require doctrine/annotations) it didn't help me (( I still have ...
Hi Ryan,
How do we handle the loading of image file fixtures (or any up-loadable files)? For example I have a product entity which contains images files, and they are uploaded and handled via a doctrine listener.
Is ...
I get this same error and I am using
use Doctrine\Common\Cache\Cache;
CRITICAL - Uncaught PHP Exception
Symfony\Component\Debug\Exception\ContextErrorException: "Notice:
Undefined property: AppBundle\Service ...
Thanks Ryan! I will try your recommendation.
All your courses use Doctrine and I keep thinking if I need to learn it because I have used SQL for many years and I don't see the point to learn an ORM adding more complexity when I don't need it (at least apparently). ...
Doh! Had an error in the UserRepository:refreshUser() function: I was returning the old $user not the new $refreshedUser obect.
Well, at least I learned something about the inner workings of Symfony & Doctrine while ...
Hello.
Please, can you tell me how to custom a query in the EntityType using DBAL? I have tried following the explanation in https://knpuniversity.com/screencast/doctrine-queries/raw-sql-queries but it was not successful.
I hope you can help me. ...
Hi there
I want to eliminate duplication for importing CSV, and Replace Into Mysql raw query kinda help that.
Is there way I can write Replace into Doctrine? If not, what is the steps to write raw query for Replace into? passing field values into Repository function and append to raw query? Not so sure, need help :) ...
I got this error, anybody can help ?
ContextErrorException:
Catchable Fatal Error: Argument 2 passed to XX\XXXBundle\EventListener\CurrentSiteListener::__construct() must
be an instance of Doctrine\ORM\EntityManager ...
Guys, i just finished Mastering Doctrine Relationships in Symfony and it looks like getting harder to me. So i need your recommendations, what should i do for next step? Should i go for next tutorial or make my own project using what i learnt and get everything done? ...
Hey Terry,
Actually, Doctrine Lifecycle Callbacks are fine and you can use it as well, but they have some limitation like you can't inject other services into the entity. That's why listeners help with it - we can do ...
Hey Dominik,
Actually, the faster way is the \@OrderBy() annotation, not \@OrderedBy(). Probably that was the case why you don't see any changes. But if you add `@ORM\OrderBy({"name": "ASC"})` annotation to the field - it should do the trick. Don't forget to "use Doctrine\ORM\Mapping as ORM;" namespace.
Cheers! ...
One question: at this point the list of studiedGenuses in the UserEditForm ist unordered. I created a queryBuilder in the GenusRepository to solve this. Is there a faster way to solve this simple order thing? The Doctrine "OrderedBy" annotation does not seem to help in this case. It's already set. ...
Hey Gremet,
If this table was generated with Doctrine - most likely so. You can easily check it by yourselves: when DB credentials is pointed, execute the next command:
```
$ bin/console doctrine:schema:validate
```
It will show you whether your DB schema is OK.
Cheers! ...
... information about relationships here:
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#one-to-many-self-referencing
Have a nice day!
2726
Doctrine
Filter Results