Category "doctrine-orm"

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

I use the last version of EasyAdmin and my add and remove functions are ignored when I submit the form: Ambiance entity: /** * @ORM\OneToMany(targetEntity="Veh

Set @JoinColumn name in doctrine

EDIT: In the end as @Jakumi commented it was just a cache issue, after clearing it everything worked as expected. There are only two hard things in Computer Sc

DateTime being persisted to one DB column but not the other in Symfony 4.4 app

I have a baffling issues where I have a DateTime object which seems to be able to be persisted and flushed to one column, but not the other. I have checked the

Doctrine simple_array returns one empty element instead of empty array

I noticed that an entity field of type simple_array does not return the correct value for empty string. Entity: namespace MyBundle\Entity; use Doctrine\ORM\Map

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

Quick Overview Hey guys! I'm working on an app that has the ability for an Order to contain multiple OrderStatus which then have a relationship with the Status

Doctrine entity listener not firing using YAML configuration

When i use the following annotation within an entity, the listener for it is called successfully. The problem with using the annotation rather than configuring

Symfony / Doctrine: OneToMany insert results in null id

I have two entities that I'm trying to apply a OneToMany / ManyToOne relationship to (one Game has many GameContent). Game /** * @ORM\OneToMany(targetEntity=

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'id_utilisateur_id' cannot be null

I am a computer science student. And I have a problem while creating an API. Here is my controller allowing the addition of a "Personnage". (POST) #[Route('/api

Postgresql/Docker - password authentication failed for user "user"

I have set database with postgresql and docker, now when I want to access to my database I have this connection error saying password authentication failed for

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

I have a column viewedAt which is a DATETIME and accept NULL values. It's a software restriction to set that column on each new record as 0000-00-00 00:00:00 so

Symfony 4: how to safely 'join' migrations together? / remove migrations in between the first and last?

I was recently tweaking around with my DB and noticed that I made 5 migrations on top of my existing 2. So 7 in total, m1, m2, ..., m7. From these 5, I only wan

CodeIgniter Fatal error: Cannot redeclare class

I'm getting the error: Fatal error: Cannot redeclare class News in application\models\Entities\News.php The two classes are as follow: application/models/News

Doctrine ORM "Multiple non-persisted new entities were found through the given association graph:"

$added_obj = []; foreach ($something as $data) { $obj = $this->class->function($data, $par2); if (null !== $obj && !(array_key_exists

Mark an individual Doctrine migration as ran/executed

Is there a way that I can mark a Doctrine migration as "ran" or "executed" in the way that it won't be shown as a migration that needs to be migrated? app/cons

How to improve my tables and queries for Big Data applications?

I created an API on Symfony which produces more than 1 million entries by day into one of the MySql tables. This table structure is defined this way: After s

Symfony2 Doctrine merge

I am studying https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/working-with-associations.html but I cannot figure out what cascade merge

Doctrine2 Criteria convert 1 to TRUE

I've got a problem with Criteria from Doctrine2. Iusing Criteria to check a SMALLINT type in PostreSQL like this : $criteria = Criteria::create()->where(Crit

insert ignore on duplicate entries in Doctrine2/Symfony2

How to ignore on duplicate entries using Doctrine2? Error example: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'symfony' for key 'UN

Doctrine 2 mapping referencing unique key

Basic question: Is it possible to map an association using Doctrine referencing not a primary but only a unique key? Extended Version: I have an Entity (Part

How to create tests w/Doctrine entities without persisting them (how to set id)

I'm working on tests for a Symfony2 project, and right now I'm looking for a way to create tests involving entity objects without persisting them. The problem i