From ca79306ae9886fd838d34140ad3f37b770fd2053 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Tue, 2 Jul 2013 23:40:24 +0300 Subject: [PATCH] configure exclusion of order field --- ipf/orm/template/orderable.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ipf/orm/template/orderable.php b/ipf/orm/template/orderable.php index 0d26546..3270828 100644 --- a/ipf/orm/template/orderable.php +++ b/ipf/orm/template/orderable.php @@ -3,11 +3,16 @@ class IPF_ORM_Template_Orderable extends IPF_ORM_Template { private $columnName = 'ord'; + private $exclude = true; public function __construct(array $options=array()) { - if ($options && array_key_exists('name', $options)) - $this->columnName = $options['name']; + if ($options) { + if (array_key_exists('name', $options)) + $this->columnName = $options['name']; + if (array_key_exists('exclude', $options)) + $this->exclude = $options['exclude']; + } } public function getColumnName() @@ -17,7 +22,7 @@ class IPF_ORM_Template_Orderable extends IPF_ORM_Template public function setTableDefinition() { - $this->hasColumn($this->columnName, 'integer', null, array('exclude' => true)); + $this->hasColumn($this->columnName, 'integer', null, array('exclude' => $this->exclude)); $this->getTable()->listeners['Orderable_'.$this->columnName] = new IPF_ORM_Template_Listener_Orderable($this->columnName); } } -- 2.49.0