예제 #1
0
파일: Book.php 프로젝트: ajnok/yii2book
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPublisher()
 {
     return $this->hasOne(Publisher::className(), ['id' => 'publisher_id']);
 }
예제 #2
0
파일: City.php 프로젝트: ajnok/yii2book
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPublishers()
 {
     return $this->hasMany(Publisher::className(), ['city_id' => 'id']);
 }