webCOMAND

collection::in_collection()

Return TRUE if $object is in the collection. Otherwise, return FALSE. Similar to PHP's in_array().

Prototype

boolean in_collection($object)

Parameters

Example

$contacts = $repo->get("FROM Contacts WHERE Name LIKE 'J%'");
$contact = $repo->get_first("FROM Contact LIMIT 1");
if( $contacts->in_collection($contact) ) {
    echo("Contact '$contact' name starts with 'J'.");
}