/**
  * @return \yii\db\ActiveQuery
  */
 public function getAuthor()
 {
     return $this->hasOne(Author::className(), ['id' => 'author_id']);
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAuthor()
 {
     return $this->hasOne(Author::className(), ['id' => 'author_id'])->inverseOf('books');
 }
Beispiel #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBookAuthors()
 {
     return $this->hasMany(Author::className(), ['id' => 'authorId'])->viaTable('author_book', ['bookId' => 'id']);
 }
Beispiel #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAuthor()
 {
     return $this->hasOne(Author::className(), ['id' => 'author_id'])->from(['author' => Author::tableName()]);
 }