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