/** * * Produces the requested beans * * */ public function getBeans($type, $machinery) { $rows = $this->toolbox->getDatabaseAdapter()->get( $machinery ); $beanCollection = array(); foreach($rows as $row) { $bean = $this->toolbox->getRedbean()->dispense($type); foreach($row as $property=>$value) { if (strpos($property,"_")===0) { $bean->setMeta($property, $value); } else { $bean->$property = $value; } } $beanCollection[] = $bean; } return $beanCollection; }