From 2b6ceb1eb7c307a2d7509be45d6ccc1551946b05 Mon Sep 17 00:00:00 2001 From: githubjeka Date: Tue, 12 Jan 2016 10:10:43 +0300 Subject: [PATCH 1/2] phpDoc updated --- framework/db/ActiveQuery.php | 5 +++-- framework/db/ActiveQueryInterface.php | 2 +- framework/db/ActiveQueryTrait.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/framework/db/ActiveQuery.php b/framework/db/ActiveQuery.php index e1725a370c..5dfdd22dd8 100644 --- a/framework/db/ActiveQuery.php +++ b/framework/db/ActiveQuery.php @@ -366,7 +366,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface * Order::find()->joinWith('books', true, 'INNER JOIN')->all(); * // find all orders, eager loading "books", and sort the orders and books by the book names. * Order::find()->joinWith([ - * 'books' => function ($query) { + * 'books' => function (\yii\db\ActiveQuery $query) { * $query->orderBy('item.name'); * } * ])->all(); @@ -622,7 +622,8 @@ class ActiveQuery extends Query implements ActiveQueryInterface * ```php * 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]); * } * ``` * diff --git a/framework/db/ActiveQueryInterface.php b/framework/db/ActiveQueryInterface.php index 4a08b66876..62ec8b7b91 100644 --- a/framework/db/ActiveQueryInterface.php +++ b/framework/db/ActiveQueryInterface.php @@ -68,7 +68,7 @@ interface ActiveQueryInterface extends QueryInterface * Customer::find()->with('orders.address')->all(); * // find customers together with their country and orders of status 1 * Customer::find()->with([ - * 'orders' => function ($query) { + * 'orders' => function (\yii\db\ActiveQueryInterface $query) { * $query->andWhere('status = 1'); * }, * 'country', diff --git a/framework/db/ActiveQueryTrait.php b/framework/db/ActiveQueryTrait.php index 4e56c0ac35..2aee476120 100644 --- a/framework/db/ActiveQueryTrait.php +++ b/framework/db/ActiveQueryTrait.php @@ -62,7 +62,7 @@ trait ActiveQueryTrait * Customer::find()->with('orders.address')->all(); * // find customers together with their country and orders of status 1 * Customer::find()->with([ - * 'orders' => function ($query) { + * 'orders' => function (\yii\db\ActiveQueryInterface $query) { * $query->andWhere('status = 1'); * }, * 'country', From 9ae21e5df2c7e51b44703f0f94376b3423198908 Mon Sep 17 00:00:00 2001 From: githubjeka Date: Tue, 12 Jan 2016 12:20:12 +0300 Subject: [PATCH 2/2] phpDoc of joinWith updated to \yii\db\ActiveQuery --- framework/db/ActiveQueryInterface.php | 2 +- framework/db/ActiveQueryTrait.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/db/ActiveQueryInterface.php b/framework/db/ActiveQueryInterface.php index 62ec8b7b91..d237ddb17a 100644 --- a/framework/db/ActiveQueryInterface.php +++ b/framework/db/ActiveQueryInterface.php @@ -68,7 +68,7 @@ interface ActiveQueryInterface extends QueryInterface * Customer::find()->with('orders.address')->all(); * // find customers together with their country and orders of status 1 * Customer::find()->with([ - * 'orders' => function (\yii\db\ActiveQueryInterface $query) { + * 'orders' => function (\yii\db\ActiveQuery $query) { * $query->andWhere('status = 1'); * }, * 'country', diff --git a/framework/db/ActiveQueryTrait.php b/framework/db/ActiveQueryTrait.php index 2aee476120..0c69044828 100644 --- a/framework/db/ActiveQueryTrait.php +++ b/framework/db/ActiveQueryTrait.php @@ -62,7 +62,7 @@ trait ActiveQueryTrait * Customer::find()->with('orders.address')->all(); * // find customers together with their country and orders of status 1 * Customer::find()->with([ - * 'orders' => function (\yii\db\ActiveQueryInterface $query) { + * 'orders' => function (\yii\db\ActiveQuery $query) { * $query->andWhere('status = 1'); * }, * 'country',