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!
If you see `doctrine/annotations v1.8.0` then you got the newest code. About DoctrineBundle version, I'm not sure to be honest but if it's not working, you can try upgrading it to version 2 or just tweak the type-hint as you did before. I think it should do the trick ...
I thought moving from stof to antishov's fork (composer require antishov/doctrine-extensions-bundle) would fix the issue for me. But it didn't do anyting appart fixing an annoying deprecation warning. So I'm still there with my modified entity and my make:migration command that sees no change. ...
... Hey guys, what's up!
I often ask myself, is there more simple way to create some dummy data to test applications instead of Fixtures? Do not misunderstand me, but I find Eloquent/Factory more friendly (simple) and flexible than Fixtures (Doctrine's or Codeception's, I've been used both). Do doctrine has the same or an analog?
Hey Stephansav,
So, Doctrine was not able to find the Article object. Please, make sure that an Article exist with the slug you specified in the URL. For this, you can check your article table in MySQL DB. Most probably you just have a typo in your slug
Cheers! ...
Hey Dung L.
Whenever you create a migration via doctrine or a maker command it will synchronize your current database schema to your application (entities metadata). I believe your database schema was just not in sync. There is a command for checking it `php bin/console doctrine:schema:validate`
Cheers! ...
I really hope, you have ElasticSearch part in your plans :).
For now, in my project, I created custom collection DataProvider, which query ElasticSearch and return results as doctrine entities collection. It works like a charm, but I'm curious what will be your approach :) ...
I have a question about de criteria filter on collection. When i use an criteria betweenDates and have a second criteria with byPerson does doctrine filter first the betweenDate and then byPerson? This because of ...
Hey Jon!
Looking at your link, it looks like your sorted it out. There's a gotcha with configuration: as soon as Doctrine sees *one* YAML mapping file, it *only* look for YAML mapping (ignores annotations, etc). This problem doesn't come up often, but I've seen it before: tough to track down.
Cheers! ...
2726
Doctrine
Filter Results