From 9e0a157fa5a241a56846cedb964def94d99bb3e5 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Mon, 12 May 2014 01:19:55 +0200 Subject: [PATCH] improved docs for AR::findAll() --- framework/db/ActiveRecordInterface.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/db/ActiveRecordInterface.php b/framework/db/ActiveRecordInterface.php index 8c1c968..61b8d98 100644 --- a/framework/db/ActiveRecordInterface.php +++ b/framework/db/ActiveRecordInterface.php @@ -183,14 +183,18 @@ interface ActiveRecordInterface public static function findOne($condition); /** - * Returns a list of active record models that match the specified primary key value or a set of column values. + * Returns a list of active record models that match the specified primary key value(s) or a set of column values. * * The method accepts: * - * - a scalar value (integer or string): query by a single primary key value and return the - * corresponding record (or null if not found). - * - an array of name-value pairs: query by a set of attribute values and return a single record - * matching all of them (or null if not found). + * - a scalar value (integer or string): query by a single primary key value and return an array containing the + * corresponding record (or an empty array if not found). + * - an array of scalar values (integer or string): query by a list of primary key values and return the + * corresponding records (or an empty array if none was found). + * Note that an empty condition will result in an empty result as it will be interpreted as a search for + * primary keys and not an empty `WHERE` condition. + * - an array of name-value pairs: query by a set of attribute values and return an array of records + * matching all of them (or an empty array if none was found). * * Note that this method will automatically call the `all()` method and return an array of * [[ActiveRecordInterface|ActiveRecord]] instances. For example,