From: Andrey Kutejko Date: Mon, 25 Nov 2013 19:22:06 +0000 (+0200) Subject: table::findAll respects orderable template now X-Git-Tag: 0.6~30 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=1b203a92c2d95f6ba1af6263c389afcd65378509;p=ipf-legacy-orm.git table::findAll respects orderable template now --- diff --git a/ipf/orm/table.php b/ipf/orm/table.php index b2708b2..6208103 100644 --- a/ipf/orm/table.php +++ b/ipf/orm/table.php @@ -524,8 +524,11 @@ class IPF_ORM_Table extends IPF_ORM_Configurable implements Countable public function findAll($hydrationMode = null) { $q = $this->createQuery(); - if ($this->_ordering) + if ($this->_ordering) { $q->orderBy(implode(', ', $this->_ordering)); + } elseif ($this->hasTemplate('IPF_ORM_Template_Orderable')) { + $q->orderBy($this->getTemplate('IPF_ORM_Template_Orderable')->getColumnName()); + } return $q->execute(array(), $hydrationMode); }