コード例 #1
0
ファイル: MenuItem.php プロジェクト: kuzmina-mariya/gallery
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
  */
 public function search()
 {
     // Warning: Please modify the following code to remove attributes that
     // should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('t.id', $this->id, true);
     $criteria->compare('t.parent_id', $this->parent_id, true);
     $criteria->compare('t.menu_id', $this->menu_id, true);
     $criteria->compare('t.title', $this->title, true);
     $criteria->compare('t.href', $this->href, true);
     if ($this->condition_name != '0') {
         $criteria->compare('t.condition_name', $this->condition_name, true);
         if ($this->condition_name != '') {
             $criteria->compare('t.condition_denial', $this->condition_denial);
         }
     } else {
         $criteria->condition('t.condition_name', '');
     }
     $criteria->compare('t.sort', $this->sort);
     $criteria->compare('t.status', $this->status);
     $criteria->with = array('menu', 'parent');
     return new yupe\components\DTreeActiveDataProvider($this, array('pagination' => false, 'criteria' => $criteria, 'childRelation' => 'childItems', 'sort' => array('defaultOrder' => 't.sort ASC')));
 }
コード例 #2
0
ファイル: MenuItem.php プロジェクト: kuzmina-mariya/4seasons
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
  */
 public function search()
 {
     // Warning: Please modify the following code to remove attributes that
     // should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('t.id', $this->id);
     $criteria->compare('t.parent_id', $this->parent_id);
     $criteria->compare('t.menu_id', $this->menu_id);
     $criteria->compare('t.title', $this->title, true);
     $criteria->compare('t.href', $this->href, true);
     if ($this->condition_name != '0') {
         $criteria->compare('t.condition_name', $this->condition_name, true);
         if ($this->condition_name != '') {
             $criteria->compare('t.condition_denial', $this->condition_denial);
         }
     } else {
         $criteria->condition('t.condition_name', '');
     }
     $criteria->compare('t.sort', $this->sort);
     $criteria->compare('t.status', $this->status);
     $criteria->with = ['menu', 'parent'];
     return new CActiveDataProvider(get_class($this), ['criteria' => $criteria, 'sort' => ['defaultOrder' => 't.sort']]);
 }
コード例 #3
0
ファイル: MenuItem.php プロジェクト: syrexby/domovoishop.by
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
  */
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('t.id', $this->id, true);
     $criteria->compare('t.parent_id', $this->parent_id, true);
     $criteria->compare('t.menu_id', $this->menu_id, true);
     $criteria->compare('t.title', $this->title, true);
     $criteria->compare('t.href', $this->href, true);
     if ($this->condition_name != '0') {
         $criteria->compare('t.condition_name', $this->condition_name, true);
         if ($this->condition_name != '') {
             $criteria->compare('t.condition_denial', $this->condition_denial);
         }
     } else {
         $criteria->condition('t.condition_name', '');
     }
     $criteria->compare('t.sort', $this->sort);
     $criteria->compare('t.status', $this->status);
     $criteria->with = ['menu', 'parent'];
     return new CActiveDataProvider(get_class($this), ['criteria' => $criteria, 'sort' => ['defaultOrder' => 't.sort']]);
 }