Merge pull request #10553 from githubjeka/phpDoc

phpDoc ActiveQuery:with/joinWith updated [skip ci]
This commit is contained in:
Alexander Makarov
2016-01-12 12:23:00 +03:00
3 changed files with 5 additions and 4 deletions

View File

@@ -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]);
* } * }
* ``` * ```
* *

View File

@@ -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',

View File

@@ -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',