Exemplo n.º 1
0
 public function getArticles($status = Article::STATUS_PUBLIC)
 {
     return $this->hasMany(Article::className(), ['parentid' => 'id'])->where(['<=', 'status', $status])->orderBy(['position' => SORT_ASC, 'updated_at' => SORT_DESC]);
 }
Exemplo n.º 2
0
 public function getArticle()
 {
     return $this->hasOne(Article::className(), ['id' => 'articleid']);
 }