... > And this is the second reason you might decide to map the inverse side of the relation:
it's required if you're doing a JOIN in this direction.
That's not true. As of Doctrine 2.3 or 2.4 (I don't remember anymore but ...
... Thx Diego.
I've made one in tag.php too and still get the users. So there has to be more!? May be a setting from Mastering Doctrine Relations! that I haven't watched yet.
With choice_label it is the same. Why uses Symfony the table users?
Hey Guido!
Not in this tutorial - DTO's aren't really related to Doctrine - they are more important depending on *how* you want to use them - like DTO's in the form component or DTO's with API Platform. What is your interest with DTO's?
Cheers! ...
There is a method.
ste had described it in answer at https://stackoverflow.com/questions/57455725/how-to-disable-foreign-key-constraint-when-using-doctrine-generate-migration
I'm exploring another way - materialized ...
Hi Dominik!
I wanted to apologize for never replying to this! Your comment somehow got stuck as "pending" and we missed it :/. If you're still having issues, let me know. It definitely looks weird as `symfony/orm-pack` requires `doctrine/orm` so that package absolutely *should* already be installed.
Cheers! ...
Hmm, you can ignore that deprecation :D
or, another solution is to manually define the name of all the tables you have problems with
```
/**
* @ORM\Table(name="table2_test")
*/
class SomeEntity
```
The naming strategy is only used when Doctrine have to give it a name to your tables/fields
Cheers! ...
Thanks a lot Ryan!
The Criteria were indeed what I was looking for. Tbh, I recently saw it in the doctrine course but I totally must have forgotten!
Anyways, thanks for the nice description and your super-fast reply, I appreciate !
Best!
Wannes ...
I think i found it.
It's the `vendor\api-platform\core\src\Bridge\Doctrine\Orm\SubresourceDataProvider.php`. If i change it back to what it was before the composer update it all works again.
It turns out that api-pack ...
Hey Alexander Steenbrugge
That's a bit weird :)
Can you try specifying the server version in your `config/packages/doctrine.yaml` file
```
doctrine:
dbal:
server_version: '5.5'
```
if that doesn't work, try upgrading MySql to 5.7, that's the recommended version to work with Symfony4+
Cheers! ...
... >getOrderstoo()) is giving me an error "An address can be an instance of Address or a string ("Doctrine\ORM\PersistentCollection") given)." ...
Hey ahmedbhs
As far as I know Symfony Messenger covers the concurrency problems when using Doctrine (the database) as a message transport. Actually, we use it on Symfonycasts, we have a couple of workers to consume all the messages and we haven't got any issues related to consume the same message twice
Cheers! ...
... Hi, I'm learning Symfony and Doctrine thanks to Sfcasts, so thank you very much for your work. In this chapter i didn't understand why we put the querybuilder->addCriteria inside findAllPublishedOrderedByNewest() if we want to re-use the logic from Criteria. thanks for yout time
Great tut!
It would be nice to update it with the latest changes to Alice (at least in the text below):
1. Using Hautelook\AliceBundle\Doctrine\DataFixtures\AbstractLoader instead of DataFixtureLoader
2. Launching update with hautelook_alice:doctrine:fixtures:load (or h:d:f:l) instead of doctrine:fixtures:load. ...
Hey Nikolay S.
> Is it better option to use json field in orders entity and store data as array in this way [1:['product':'5','productmodel':'10']]?
I don't think that's a good idea because it's going to be hard to make it work with Doctrine. The question here is why you need to store the ProductModel? ...
Hey Jason O.!
Hmm. The way it's parsed is determined by the Doctrine annotations parser, and actually, *both* of these syntaxes should be valid (I usually *always* include the `()`, but I believe their optional). What error do you get when you try `@Assert\NotBlank()`?
Cheers! ...
... learning those relations things from doctrine which I want to learn first, once I have mastered that,its very likely ill explore encore.
Hey Olivier
That's a good question and by looking at the ApiPlatform docs I couldn't find anything related to define 2 strategies on the same property. So, I think what you need to do is to create your own filter by following this steps: https://api-platform.com/docs/core/filters/#creating-custom-doctrine-orm-filters
Cheers! ...
... Yea, I've never tried it. Strictly speaking, it's fine to do this directly in Doctrine, and my impression of Alice is mostly that it is simply calling the setters on your entity methods and then persisting them - in which case there would be no issue. But I'm guessing there's something complication I'm not seeing :)
That brings out a question - suppose I created a wrapper for the Doctrine paginator which DOES translate limit/offset because it's something I do a lot. Where would you put it? I suppose if there were many such wrappers ...
... ;
$entityManager
->createQuery(sprintf('DELETE FROM %s', $alias))
->execute()
;
```
// delete all tables
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
$purger = new ORMPurger($entityManager);
$purger->purge();
```
Cheers!
2709
Doctrine
Filter Results