Bug #44244
defaultOrderings aren't applied on related objects
Status: | New | Start date: | 2012-12-28 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | Persistence | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | Flow 2.0.0 beta 1 |
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"})
History
#1 Updated by Alexander Berl over 2 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.