findOrDispense() public method

Note that this function always returns an array.
See also: Finder::find
public findOrDispense ( string $type, string $sql = NULL, array $bindings = [] ) : array
$type string the type of bean you are looking for
$sql string SQL query to find the desired bean, starting right after WHERE clause
$bindings array values array of values to be bound to parameters in query
return array
Exemplo n.º 1
0
 /**
  * Convience method. Tries to find beans of a certain type,
  * if no beans are found, it dispenses a bean of that type.
  *
  * @param  string $type     type of bean you are looking for
  * @param  string $sql      SQL code for finding the bean
  * @param  array  $bindings parameters to bind to SQL
  *
  * @return array
  */
 public static function findOrDispense($type, $sql = NULL, $bindings = array())
 {
     return self::$finder->findOrDispense($type, $sql, $bindings);
 }