filterAny method comments fixed to reflect actual operation

This commit is contained in:
Tadas Giniotis 2014-11-13 22:04:29 +02:00
parent 437fc2fda7
commit 2f59a6c59b

View File

@ -355,21 +355,21 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab
} }
/** /**
* Return a copy of this list which does not contain items matching any of these charactaristics. * Return a copy of this list which contains items matching any of these charactaristics.
* *
* @example // filter bob from list * @example // only bob in the list
* $list = $list->filterAny('Name', 'bob'); * $list = $list->filterAny('Name', 'bob');
* // SQL: WHERE "Name" = 'bob' * // SQL: WHERE "Name" = 'bob'
* @example // filter aziz and bob from list * @example // azis or bob in the list
* $list = $list->filterAny('Name', array('aziz', 'bob'); * $list = $list->filterAny('Name', array('aziz', 'bob');
* // SQL: WHERE ("Name" IN ('aziz','bob')) * // SQL: WHERE ("Name" IN ('aziz','bob'))
* @example // filter by bob or anybody aged 21 * @example // bob or anyone aged 21 in the list
* $list = $list->filterAny(array('Name'=>'bob, 'Age'=>21)); * $list = $list->filterAny(array('Name'=>'bob, 'Age'=>21));
* // SQL: WHERE ("Name" = 'bob' OR "Age" = '21') * // SQL: WHERE ("Name" = 'bob' OR "Age" = '21')
* @example // filter by bob or anybody aged 21 or 43 * @example // bob or anyone aged 21 or 43 in the list
* $list = $list->filterAny(array('Name'=>'bob, 'Age'=>array(21, 43))); * $list = $list->filterAny(array('Name'=>'bob, 'Age'=>array(21, 43)));
* // SQL: WHERE ("Name" = 'bob' OR ("Age" IN ('21', '43')) * // SQL: WHERE ("Name" = 'bob' OR ("Age" IN ('21', '43'))
* @example // bob age 21 or 43, phil age 21 or 43 would be excluded * @example // all bobs, phils or anyone aged 21 or 43 in the list
* $list = $list->filterAny(array('Name'=>array('bob','phil'), 'Age'=>array(21, 43))); * $list = $list->filterAny(array('Name'=>array('bob','phil'), 'Age'=>array(21, 43)));
* // SQL: WHERE (("Name" IN ('bob', 'phil')) OR ("Age" IN ('21', '43')) * // SQL: WHERE (("Name" IN ('bob', 'phil')) OR ("Age" IN ('21', '43'))
* *