samples/PhotoAlbum/lib/rb.php
public static function dispense( $type, $num = 1 ) {
		if (!preg_match('/^[a-z0-9]+$/',$type) && self::$strictType) throw new RedBean_Exception_Security('Invalid type: '.$type); 
		if ($num==1) {
			return self::$redbean->dispense( $type );
		}
		else {
			$beans = array();
			for($v=0; $v<$num; $v++) $beans[] = self::$redbean->dispense( $type );
			return $beans;
		}
	}
public static function dispense( $type, $num = 1 ) {
		if (!preg_match('/^[a-z0-9]+$/',$type) && self::$strictType) throw new RedBean_Exception_Security('Invalid type: '.$type); 
		if ($num==1) {
			return self::$redbean->dispense( $type );
		}
		else {
			$beans = array();
			for($v=0; $v<$num; $v++) $beans[] = self::$redbean->dispense( $type );
			return $beans;
		}
	}
public static function dispense ( $ type , $ num = 1 ) { if ( ! preg_match ( '/^[a-z0-9]+$/' , $ type ) && self :: $ strictType ) throw new RedBean_Exception_Security ( 'Invalid type: ' . $ type ) ; if ( $ num == 1 ) { return self :: $ redbean -> dispense ( $ type ) ; } else { $ beans = array ( ) ; for ( $ v = 0 ; $ v < $ num ; $ v ++ ) $ beans [ ] = self :: $ redbean -> dispense ( $ type ) ; return $ beans ; } }
Dispenses a new RedBean OODB Bean for use with
the rest of the methods.

@param string  $type   type
@param integer $number number of beans to dispense

@return array $oneOrMoreBeans
Dispenses a new RedBean OODB Bean for use with the rest of the methods .