alternative for doctrine deprecated ping()

DoctrineDBALConnection::ping() is marked as @deprecated I found this commit that introduced it but no info about successor for this method was given. I would like to know what is expected …

A form can return varying number of values, trying to use the returned values in doctrine query

I have saved a bunch of parsed messages in a db, and I want to be able to pull out results depending on user input. I would like to sort by 1-4 values (more options later on), username, id, email or …

Add TINYINT to Doctrine SQL types

Following Symfony doc, I tried to add TINYINT as entity column type. So far it works well, but two problem remain… Each time I want to perform a migration, Doctrine can’t reconize TINYINT for the …

How can I get access to related entities with Symfony doctrine?

I try to find all documents that are related to my product: public function findDocumentsRelatedToProduct($id) { return $this->createQueryBuilder(‘products’) ->…

Doctrine get Product with most sales

I have a Product Entity with many Orders as association. I want to build a repository method that brings the most sold products. Each order only have 1 product with 1 quantity so, quantity is …

Foreign Key in Doctrine (Symfony). How do I bind a new child to an already existing parent?

There is a database of Regions and Cities. The relationship between the regions and cities tables is one-to-many. Below is my code for adding a new city to the database. It gives an error: https://i….

Do I have to persist object from repository in Doctrine?

Do I have to persist the object I fetched from a repository? For example: $foo = $this->repository->find($id); $foo->setBar($baz); $this->flush(); Do I have to add $this->persist($foo)…

Doctrine query builder – where IN with non string column names can’t be generated

I can’t sleep because of this, I either must be missing something really obvious or it can’t be done like that. I have this Doctrine Query Builder thingy: $this->queryBuilder ->…

Fix broken migrations by “resetting” to current schema

We have taken over an old (3 years) Symfony 3.3 project using the doctrine-migrations 1.0 bundle for handling migrations. Unfortunately, the migration scripts have been broken for some time without …

How i persist data with @ManyToMany Symfony4

I have problem when I want import data (csv) officer with relation ManyToMany Department : the officer (agent in french) are store but the relation are not created (table agent_departement). Agent …