... EntityManager into your service, and replace all calls to `$this->getDoctrine()`
E.G.
```
// YourService.php
use Doctrine\ORM\EntityManagerInterface;
class SomeService
{
// This is how you inject the EntityManager into ...
... DataPersister are only used when reading/writing a resource through an API request, so loading fixtures with AliceBundle or creating a user programmatically won't trigger the password encoding.
Using a Doctrine ...
... attribute)? I load a list of products via 'class' but on after selecting something and hit save i get error:
"Unable to transform value for property path "licensed_products": Expected a Doctrine\Common\Collections\Collection ...
... delete them at the end of the request. Life is sad but I know this is the right thing to do.
2) Yes, doing this already, it's fine.
3) Mmm agree, on Doctrine transport it'll definitively take too long and i'm working on ...
Hey Rob,
As I understand you want to apply Doctrine criteria on the simple PHP array - you can't. Criteria can be applied on Doctrine's ArrayCollection only. Or instead of returning the result array in your repository ...
... see that the `dir` option of your managers is wrong. Your entities should be isolated into their own folder. I recommend you to read this piece of documentation https://symfony.com/doc/current/doctrine/multiple_entity_managers.html but if you have more questions feel free to ask us :)
Cheers!
Hey Avraham M.
If you want to cache queries, you can use Doctrine cache to do it but I don't recommend it because you would have to purge the cache whenever your object changes and it can be very problematic. What you ...
... course) - the updatedAt part would likely require to hack the value in (assuming no setter) on some doctrine event, just like I did with the other thing in my previous question.
If the answer is no - what would be the recommended way to set both createdAt and updatedAt for entity marked as ApIResource?
... episode where Ryan explains it: https://symfonycasts.com/screencast/symfony3-doctrine-relations/param-conversion
Or, you can read the docs: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
Cheers!
... \Entity\Teams" instead? Otherwise, you should set PlayersTeams entity instead of Teams.
Btw, I'd recommend you also to check your Doctrine mapping configuration with the command:
$ bin/console doctrine:schema:validate ...
... "continue" targeting switch is equivalent to "break". Did you mean
to use "continue 2"? `
Also I have the same error when I try to create a database with doctrine. Please help, how can I fix it?
... OneToMany AB
B OneToMany AB
Probably this answer may help you out to understand it a bit more: https://groups.google.com/forum/#!topic/doctrine-user/0dh8lgUudvc
Cheers!
Hey Josan!
Hmm, interesting! If you look at the query it generates at around time 2:34 (https://symfonycasts.com/screencast/doctrine-relations/many-to-many-joins?playAt=150 ) it's a LEFT JOIN from article to ...
... /screencast/symfony-doctrine
or a more advanced tutorial (Built on Symfony3): https://symfonycasts.com/screencast/collections
I hope this helps. Cheers!
Hey Ryan!
Thanks for the reply. Yep. I've done all those things as well. I even deleted the `composer.lock` file, made sure that I had the latest version in my `composer.json` file (`"stof/doctrine-extensions-bundle ...
... installed. As you noted, the *true* version you have installed can be found in composer.lock (or via `composer show stof/doctrine-extensions-bundle`. However, running `composer install` doesn't update the composer.lock file ...
... composer.json (which appears to be the latest version on packagist):
`"stof/doctrine-extensions-bundle": "^1.3"`
Then in stof_doctrine_extensions.yaml:
`stof_doctrine_extensions:
default_locale: en_US
orm ...
Hello Kenan here again, I want to share what happens in both Windows 10 x64 and Fedora 30
When I tried to run:
`composer require doctrine`
I got the following:
Installation failed, reverting ./composer.json to its ...
... consideration the user that was logged in (in another symfony application with a static database connection to this "central" database).
I thought about using a subscriber for KernelRequest. But how would I make the connection of doctrine dynamically? And will each user really be totally isolated from others? Thanks!!
Hello again...
// src/Yoda/UserBundle/Doctrine/UserListener.php
// ...
use Yoda\UserBundle\Entity\User;
// ...
private function handleEvent(User $user)
{
$plainPassword = $user->getPlainPassword();
$encoder = $this ...
2725
Doctrine
Filter Results