Service class to find beans. For the most part this class offers user friendly utility methods for interacting with the OODB::find() method, which is rather complex. This class can be used to find beans using plain old SQL queries.
Author: Gabor de Mooij and the RedBeanPHP Community
Exemplo n.º 1
0
 /**
  * Tries to find beans matching the specified type and
  * criteria set.
  *
  * If the optional additional SQL snippet is a condition, it will
  * be glued to the rest of the query using the AND operator.
  *
  * @param string $type type of bean to search for
  * @param array  $like optional criteria set describing the bean to search for
  * @param string $sql  optional additional SQL for sorting
  *
  * @return array
  */
 public static function findLike($type, $like = array(), $sql = '')
 {
     return self::$finder->findLike($type, $like, $sql);
 }
Exemplo n.º 2
0
 /**
  * @see Facade::find
  * This variation returns the last bean only.
  *
  * @param string $type     type   the type of bean you are looking for
  * @param string $sql      sql    SQL query to find the desired bean, starting right after WHERE clause
  * @param array  $bindings values array of values to be bound to parameters in query
  *
  * @return OODBBean
  */
 public static function findLast($type, $sql = NULL, $bindings = array())
 {
     return self::$finder->findLast($type, $sql, $bindings);
 }