From ad69b0f8cb467dc76d800a643134201afe8ac0c1 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 26 Nov 2015 00:11:03 +0100 Subject: [PATCH] added note about fields that can be used in onCondition --- framework/db/ActiveQuery.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framework/db/ActiveQuery.php b/framework/db/ActiveQuery.php index 2b7b075418..e1725a370c 100644 --- a/framework/db/ActiveQuery.php +++ b/framework/db/ActiveQuery.php @@ -626,6 +626,10 @@ class ActiveQuery extends Query implements ActiveQueryInterface * } * ``` * + * Note that this condition is applied in case of a join as well as when fetching the related records. + * Thus only fields of the related table can be used in the condition. Trying to access fields of the primary + * record will cause an error in a non-join-query. + * * @param string|array $condition the ON condition. Please refer to [[Query::where()]] on how to specify this parameter. * @param array $params the parameters (name => value) to be bound to the query. * @return $this the query object itself