Commit 9e0a157f by Carsten Brandt

improved docs for AR::findAll()

parent cb830f74
...@@ -183,14 +183,18 @@ interface ActiveRecordInterface ...@@ -183,14 +183,18 @@ interface ActiveRecordInterface
public static function findOne($condition); 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: * The method accepts:
* *
* - a scalar value (integer or string): query by a single primary key value and return the * - a scalar value (integer or string): query by a single primary key value and return an array containing the
* corresponding record (or null if not found). * corresponding record (or an empty array if not found).
* - an array of name-value pairs: query by a set of attribute values and return a single record * - an array of scalar values (integer or string): query by a list of primary key values and return the
* matching all of them (or null if not found). * 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 * Note that this method will automatically call the `all()` method and return an array of
* [[ActiveRecordInterface|ActiveRecord]] instances. For example, * [[ActiveRecordInterface|ActiveRecord]] instances. For example,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment