/**
  * 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 function findOrDispense($type, $sql = NULL, $bindings = array())
 {
     return $this->finder->findOrDispense($type, $sql, $bindings);
 }
Exemple #2
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);
 }
Exemple #3
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  $values parameters to bind to SQL
  *
  * @return array $beans Contains RedBean_OODBBean instances
  */
 public static function findOrDispense($type, $sql = null, $values = array())
 {
     return self::$finder->findOrDispense($type, $sql, $values);
 }