Пример #1
0
 /**
  * Dispenses a new bean (a OODBBean Bean Object)
  * of the specified type. Always
  * use this function to get an empty bean object. Never
  * instantiate a OODBBean yourself because it needs
  * to be configured before you can use it with RedBean. This
  * function applies the appropriate initialization /
  * configuration for you.
  *
  * @param string  $type              type of bean you want to dispense
  * @param string  $number            number of beans you would like to get
  * @param boolean $alwaysReturnArray if TRUE always returns the result as an array
  *
  * @return OODBBean
  */
 public function dispense($type, $number = 1, $alwaysReturnArray = FALSE)
 {
     if ($number < 1) {
         if ($alwaysReturnArray) {
             return array();
         }
         return NULL;
     }
     return $this->repository->dispense($type, $number, $alwaysReturnArray);
 }