Exemplo n.º 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'category_id']);
 }
Exemplo n.º 2
0
 /**
  * @param string action
  * @param mixed $constrain
  * @return array
  */
 public static function getCategories($constrain = null)
 {
     $ret_val = [];
     $where = is_array($constrain) ? $constrain : ['type_id' => 1];
     return Category::find()->where($where)->orderBy('slug');
 }
Exemplo n.º 3
0
 public function requestFor()
 {
     return \nitm\helpers\Relations::getRelatedRecord('requestFor', $this, CategoryModel::className());
 }