... ")
*/
private $user;
```
Then when I run:
```
console doctrine:migrations:diff
[Doctrine\DBAL\Schema\SchemaException]
There is no column with name 'user' on table 'course'.
```
...
Hey @Paolo!
Cool question! And yes! This is done with the JoinColumn: https://knpuniversity.com/screencast/doctrine-relations/join-column-relation-fixtures, specifically the onDelete setting. I usually let it stay as ...
At my doctrine.yaml I have the following configuration:
```yaml
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
```
I want to connect to 2 different databases with the following configuration ...
... entity, but doesn't store in DB (doesn't handle with Doctrine). Frequently, in Symfony projects, models uses in form type as data classes.
Cheers!
Ah, great question :). Unfortunately, it's just one of those things that's up to the docs of the different libraries to support. *Ideally*, it would be on the php doc of the interface. For Doctrine, that's true (it ...
...
```
use ApiPlatform\Doctrine\Common\State\PersistProcessor;
#[AsDecorator(PersistProcessor::class)]
```
I get an error when launching tests
```
"An exception occurred while executing a query: SQLSTATE[23502]: Not null ...
... integration myself, but it looks a lot like the Doctrine support: there is a built-in `CollectionProvider` that knows how to pull data from ElasticSearch and populate your custom class.
I hope this short answer at least helps a little bit :).
Cheers!
I cannot get cache to work for me either. There were files in there but when I deleted the doctrine directory it never came back. I mapped $key to twig and dumped it and sure enough there was an md5 hash in there. You ...
... I succeed in doing so with a class that implements a Doctrine eventListener but the controller remains isolated, i.e. I can't pass any further variables from the controller to the event, I can only handle the entity. I ...
... /doctrine_cache. You said you followed word-for-word - but this was the most obvious thing to check, so let's start there!
2) If you delete the var/cache/dev/doctrine... directory and then refresh, is it re-created? Or does this ...
Hello, Ryan!
[1] Really handy optimization for reducing query count with addSelect().
[2] Is there an equivalent method of reducing query count for a Tree?
(Tree - Nestedset behavior extension for Doctrine ...
... "registerLoader" of class "Doctrine\Common\Annotations\AnnotationRegistry".
To continue coding while I get answer to this question, i did the following:
1. I run the command: "composer remove sensio/framework-extra-bundle"
2. revert the function show as it was.
Any advice how to proceed?
Thanks!
... configure an association here (just click on the YAML option) https://symfony.com/doc/current/doctrine/associations.html#mapping-the-manytoone-relationship
And you may want to read how to configure your entities when ...
Hey Szymon,
In this tutorial, the only difference you'll find if you use MySQL instead of PostgreSQL is the migration files. The queries generated by Doctrine will be specific to MySQL, but besides that, nothing else ...
Hey Dmitriy,
But Doctrine already does this for you. You just need to generate an entity via MakerBundle, or make sure your User entity has this mapping config:
```php
User
{
#[ORM\Id, ORM\Column, ORM ...
... = $this->container->get('doctrine')->getManager();
/** @var \App\Bundle\CoreBundle\Entity\Repository\AccountRepository $account */
$account = $em->getRepository('CoreBundle:Account')->find(1);
return ...
Hi,
Do you have a `NotNull` constraint on `User` field? I think it's a little complex problem because Validation is called before any Doctrine Listener that changes data before persisting, so the easiest way to get ...
Hi Ryan,
This can also be accomplished with two entity managers and having the corresponding entities in different subdirectories.
This post talks about it: http://stackoverflow.com/questions/12220198/using-doctrine-2 ...
... finish out the Symfony 6 course (Doctrine relations, forms and security) as early as we can this year. It's hard to look at annotations once you get used to attributes!
Cheers!
Hi Mihail!
Hmm, this is interesting. I can see what's happening: I think when you upgraded Doctrine, you also upgraded Symfony - it appears that it's in some weird state where part of your code is on Symfony 3, and ...
2709
Doctrine
Filter Results