From eee575735bf127c97a3f3ca1fae2400226285bea Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Mon, 25 Nov 2013 21:22:06 +0200 Subject: [PATCH] table::findAll respects orderable template now --- ipf/orm/table.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.49.0