samples/PhotoAlbum/lib/rb.php
public static function dispenseLabels($type,$labels) {
		$labelBeans = array();
		foreach($labels as $label) {
			$labelBean = self::dispense($type);
			$labelBean->name = $label;
			$labelBeans[] = $labelBean;
		}
		return $labelBeans;
	}
public static function dispenseLabels($type,$labels) {
		$labelBeans = array();
		foreach($labels as $label) {
			$labelBean = self::dispense($type);
			$labelBean->name = $label;
			$labelBeans[] = $labelBean;
		}
		return $labelBeans;
	}
public static function dispenseLabels ( $ type , $ labels ) { $ labelBeans = array ( ) ; foreach ( $ labels as $ label ) { $ labelBean = self :: dispense ( $ type ) ; $ labelBean -> name = $ label ; $ labelBeans [ ] = $ labelBean ; } return $ labelBeans ; }
A label is a bean with only an id, type and name property.
This function will dispense beans for all entries in the array. The
values of the array will be assigned to the name property of each
individual bean.

@param string $type   type of beans you would like to have
@param array  $labels list of labels, names for each bean

@return array $bean a list of beans with type and name property
A label is a bean with only an id type and name property . This function will dispense beans for all entries in the array . The values of the array will be assigned to the name property of each individual bean .