From: Andrey Kutejko Date: Mon, 25 Nov 2013 19:22:06 +0000 (+0200) Subject: table::findAll respects orderable template now X-Git-Tag: 0.5~15 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=eee575735bf127c97a3f3ca1fae2400226285bea;p=ipf.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); }