Bug #44244

defaultOrderings aren't applied on related objects

Added by Martin Br├╝ggemann almost 8 years ago. Updated almost 8 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Persistence
Target version:
-
Start date:
2012-12-28
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

I tried to load objects and their related subobjects and put them out within a fluid template. Unfortunately the subobjects had the wrong sorting - even after having set the $defaultOrderings variable in the subobjects repository correctly. The only workaround that works is setting the following ORM-option in the subobjects model:

* @ORM\OrderBy({"date" = "DESC"})
#1

Updated by Alexander Berl almost 8 years ago

Subobjects (in a collection) are not fetched through their (possibly not existing) repository, hence the annotation solution is the correct one.

Note: The existence of a matching repository denotes a domain object as a domain root, but not all domain objects necessarily need to be roots.

Also available in: Atom PDF