mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 22:09:48 +08:00
Merge pull request #10553 from githubjeka/phpDoc
phpDoc ActiveQuery:with/joinWith updated [skip ci]
This commit is contained in:
@@ -366,7 +366,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
|||||||
* Order::find()->joinWith('books', true, 'INNER JOIN')->all();
|
* Order::find()->joinWith('books', true, 'INNER JOIN')->all();
|
||||||
* // find all orders, eager loading "books", and sort the orders and books by the book names.
|
* // find all orders, eager loading "books", and sort the orders and books by the book names.
|
||||||
* Order::find()->joinWith([
|
* Order::find()->joinWith([
|
||||||
* 'books' => function ($query) {
|
* 'books' => function (\yii\db\ActiveQuery $query) {
|
||||||
* $query->orderBy('item.name');
|
* $query->orderBy('item.name');
|
||||||
* }
|
* }
|
||||||
* ])->all();
|
* ])->all();
|
||||||
@@ -622,7 +622,8 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
|||||||
* ```php
|
* ```php
|
||||||
* public function getActiveUsers()
|
* public function getActiveUsers()
|
||||||
* {
|
* {
|
||||||
* return $this->hasMany(User::className(), ['id' => 'user_id'])->onCondition(['active' => true]);
|
* return $this->hasMany(User::className(), ['id' => 'user_id'])
|
||||||
|
* ->onCondition(['active' => true]);
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ interface ActiveQueryInterface extends QueryInterface
|
|||||||
* Customer::find()->with('orders.address')->all();
|
* Customer::find()->with('orders.address')->all();
|
||||||
* // find customers together with their country and orders of status 1
|
* // find customers together with their country and orders of status 1
|
||||||
* Customer::find()->with([
|
* Customer::find()->with([
|
||||||
* 'orders' => function ($query) {
|
* 'orders' => function (\yii\db\ActiveQuery $query) {
|
||||||
* $query->andWhere('status = 1');
|
* $query->andWhere('status = 1');
|
||||||
* },
|
* },
|
||||||
* 'country',
|
* 'country',
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ trait ActiveQueryTrait
|
|||||||
* Customer::find()->with('orders.address')->all();
|
* Customer::find()->with('orders.address')->all();
|
||||||
* // find customers together with their country and orders of status 1
|
* // find customers together with their country and orders of status 1
|
||||||
* Customer::find()->with([
|
* Customer::find()->with([
|
||||||
* 'orders' => function ($query) {
|
* 'orders' => function (\yii\db\ActiveQuery $query) {
|
||||||
* $query->andWhere('status = 1');
|
* $query->andWhere('status = 1');
|
||||||
* },
|
* },
|
||||||
* 'country',
|
* 'country',
|
||||||
|
|||||||
Reference in New Issue
Block a user