/** * Returns the alias for a type * * @param $type aliased type * * @return string $type type */ public function getAlias($type) { if ($t = RedBean_OODBBean::$fetchType) { $type = $t; RedBean_OODBBean::$fetchType = null; } return $type; }
/** * Chainable method to cast a certain ID to a bean; for instance: * $person = $club->fetchAs('person')->member; * This will load a bean of type person using member_id as ID. * * @param string $type preferred fetch type * * @return RedBean_OODBBean */ public function fetchAs($type) { self::$fetchType = $type; return $this; }