]> git.andy128k.dev Git - ipf.git/commitdiff
order foreign relation
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 17 Aug 2013 08:00:54 +0000 (11:00 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 17 Aug 2013 08:00:54 +0000 (11:00 +0300)
ipf/orm/relation/foreignkey.php

index b0c64f0021e0ec34b5292e17d1dbfd2dcf388d16..5e5a91f671d8ec9b9f308a8411ffff06134782a8 100644 (file)
@@ -51,6 +51,10 @@ class IPF_ORM_Relation_ForeignKey extends IPF_ORM_Relation
               . ' WHERE ' . $component . '.' . $this->definition['foreign']
               . ' IN (' . substr(str_repeat('?, ', $count), 0, -2) . ')';
 
+        $ordering = $table->getOrdering();
+        if ($ordering)
+            $dql .= ' ORDER BY ' . implode(', ', $ordering);
+
         return $dql;
     }