From: Alexander Meteiko Date: Tue, 9 Nov 2010 17:15:07 +0000 (+0200) Subject: ListTreeFilter - _getObjects method is added by andrevv X-Git-Tag: 0.5~352 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=e2c3bf9b664aeaee7d1ca3a82c3498a6b37cf58a;p=ipf.git ListTreeFilter - _getObjects method is added by andrevv --- diff --git a/ipf/admin/model.php b/ipf/admin/model.php index a1aa762..968b02e 100644 --- a/ipf/admin/model.php +++ b/ipf/admin/model.php @@ -69,7 +69,7 @@ class ListTreeFilter extends BaseListFilter{ 'local'=>$mrels[$fname]->getLocal(), 'parent_key'=>$parent_key, 'class'=>$mrels[$fname]->getClass(), - 'objects'=>IPF_ORM_Query::create()->from($mrels[$fname]->getClass())->orderby('ord')->execute(), + 'objects'=>$this->_getObjects($mrels[$fname]->getClass()), ); } } @@ -77,6 +77,13 @@ class ListTreeFilter extends BaseListFilter{ parent::__construct($title, $choices); } + protected function _getObjects($modelName) + { + return IPF_ORM_Query::create() + ->from($modelName) + ->orderby('ord') + ->execute(); + } protected function _collectTreeRecursive(&$choices,$level=0,$parent_id=null,$valname=''){ foreach($this->fields[$level]['objects'] as $o){