I have a Symfony project and I’m trying to get a list of available commands in my controller, so I tried to execute the list-command (together with –format=xml) to achieve that. I used the code listed here to run a command from a controller but end up with the error “Not passing a connection provider as the first constructor argument
Tag: doctrine
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 …
Convert PHP Doctrine date to JS [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question There is a webservice that provides me dates in JSON format like this: Which would be the easiest way to
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….
Doctrine ArrayCollection refuses to update after insert
I’m trying to save a collection of files. When I save a collection, it goes into the DB without a hitch. Same with files. But when I add a collection and a new file in the same request (like here in the upload function). Whenever I then ask doctrine to get me the files in the collection (in this case
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 …