/** * Load a channel from the database and return it as a MyChannel object. * Subsequent loads will be returned from the channel cache. * * @param $id \b int the channel id * @return MyChannel */ public static function fetch($id) { // fetch record if it's not already in the cache if (!isset(self::$cache[$id])) { $channel = parent::fetch($id, __CLASS__); if ($channel) { self::$cache[$id] = $channel; } else { throw new Exception('Unknown channel requested: ' . $id); } } return self::$cache[$id]; }
/** * Fetch overload. */ public static function fetch($id, $class = __CLASS__) { return parent::fetch($id, $class); }
/** * @todo delete */ public function fetch($id, $obj_or_class) { MyPortalObject::fetch($id, $obj_or_class); }