Top "Doctrine-orm" questions

Doctrine ORM is a PHP ORM.

Doctrine Cascade Options for OneToMany

I'm having a hard time making sense of the Doctrine manual's explanation of cascade operations and need someone to help …

doctrine-orm cascade
"usort" a Doctrine\Common\Collections\ArrayCollection?

In various cases I need to sort a Doctrine\Common\Collections\ArrayCollection according to a property in the object. Without …

php doctrine-orm
Checking for duplicate keys with Doctrine 2

Is there an easy way to check for duplicate keys with Doctrine 2 before doing a flush?

doctrine doctrine-orm
How can I use SQL's YEAR(), MONTH() and DAY() in Doctrine2?

I want to perform a query which would look like this in native SQL: SELECT AVG(t.column) AS average_…

mysql sql doctrine-orm sql-date-functions
Explicitly set Id with Doctrine when using "AUTO" strategy

My entity uses this annotation for it's ID: /** * @orm:Id * @orm:Column(type="integer") * @orm:GeneratedValue(strategy="AUTO") */ protected $id; …

doctrine doctrine-orm
Doctrine inserting in postPersist event

I want add new Feed item on entity persist and update. I write this event listener (postUpdate is same): public …

symfony doctrine-orm symfony-sonata
How to check if entity changed in Doctrine 2?

I need to check if a persisted entity has changed and needs to be updated on the database. What I …

php doctrine doctrine-orm
How to write UNION in Doctrine 2.0

How to write this SQL query in Doctrine 2.0 (and fetch results)? (SELECT 'group' AS type, CONCAT(u.firstname, " ", u.surname) …

sql union doctrine-orm
(doctrine2 + symfony2) cascading remove : integrity constraint violation 1451

First, sorry for my poor English... I got four entities : User, Application, Bundle & Entity. Here are their relations (with …

symfony doctrine-orm cascading referential-integrity
Doctrine: Cannot select entity through identification variables without choosing at least one root entity alias

I'm using the following code in the query builder, to select an average of score values, and the category entity …

doctrine-orm doctrine doctrine-query