예제 #1
0
 /**
  * Документ
  * @return \yii\db\ActiveQuery
  */
 public function getDocument()
 {
     return $this->hasOne(Document::className(), ['id' => 'document_id']);
 }
예제 #2
0
 /**
  * Дочерние документы
  * @return $this
  */
 public function getChildren()
 {
     return $this->hasMany(Document::className(), ['parent_id' => 'id'])->orderBy(['position' => SORT_ASC]);
 }
예제 #3
0
 /**
  * Документы с текущим шаблоном
  * @return \yii\db\ActiveQuery
  */
 public function getDocuments()
 {
     return $this->hasMany(Document::className(), ['template_id' => 'id']);
 }