Пример #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEntities()
 {
     return $this->hasMany(Entity::className(), ['entity_type_id' => 'id']);
 }
Пример #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFromEntity()
 {
     return $this->hasOne(Entity::className(), ['id' => 'from_entity_id']);
 }