Category "doctrine-orm"

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

Symfony HttpFoundation UploadedFile "not uploaded due to unknown error" when using Doctrine DataFixtures

I've been using my Attachment entity based on the cookbook recipie How To Handle File Uploads With Doctrine in Symfony 2.3. It works well, even in functional t