本文整理匯總了PHP中app\models\Book::className方法的典型用法代碼示例。如果您正苦於以下問題:PHP Book::className方法的具體用法?PHP Book::className怎麽用?PHP Book::className使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Book
的用法示例。
在下文中一共展示了Book::className方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getBooks
/**
* @return \yii\db\ActiveQuery
*/
public function getBooks()
{
return $this->hasMany(Book::className(), ['tour_id' => 'id']);
}
示例2: getBooks
/**
* @return $this
*/
public function getBooks()
{
return $this->hasMany(Book::className(), ['id' => 'book_id'])->viaTable(BooksUsers::tableName(), ['user_id' => 'id']);
}
示例3: getBooks
/**
* @return $this
*/
public function getBooks()
{
return $this->hasMany(Book::className(), ['id' => 'book_id'])->viaTable(BooksCategories::tableName(), ['category_id' => 'id']);
}
示例4: getBook
public function getBook()
{
return $this->hasOne(Book::className(), ['id' => 'book_id']);
}
示例5: getBooks
public function getBooks()
{
return $this->hasMany(Book::className(), ['id' => 'book_id'])->via('userBooks');
}
示例6: getBooks
public function getBooks()
{
return $this->hasMany(\app\models\Book::className(), ['book_id' => 'book_id'])->viaTable('rel_library_book', ['library_id' => 'library_id']);
}
示例7: getBooks
public function getBooks()
{
return $this->hasMany(Book::className(), ['id' => 'book_id'])->viaTable('genre_book', ['genre_id' => 'id']);
}
示例8: getBooks
/**
* @return \yii\db\ActiveQuery
*/
public function getBooks()
{
return $this->hasMany(Book::className(), ['author_id' => 'id'])->inverseOf('author');
}