The searchItems() method of all managers requires a criteria object whose conditions are used to limit the result set only to the necessary entries. The conditions are in an abstract notation which is translated to the real notation of the underlying storage (e.g. SQL for databases) before sending the query to the storage manager (the database server in case of SQL).
There are two types of operators available, one for comparing items against values and one for combining one or more terms (compare or further combine terms).
List of combination operators:
List of comparison operators:
With these operators, you can build conditions of any complexity, e.g.
$search = $productManager->createSearch( true );
$expr = array(
$search->compare( '==', 'product.id', <array of IDs> ),
$search->compare( '>=', 'product.mtime', '2012-01-01 00:00:00' ),
$search->setConditions( $search->combine( '&&', $expr );
$productManager->searchItems( $search );
This code block would search for all products whose ID is in the list of IDs and which has a modification time later than begin of 2012. The result would also be limited by the default conditions (which are filtering by "product.status", "product.datestart" and "product.dateend") because of the "true" parameter in the createSearch() call and the $search->getConditions() as first expression.