/** * Retrieve a starred object * * @param string $object_model * @param int $object_id * @return object */ public static function retrieveStarredObject($object_model, $object_id) { try { $peer = sprintf('%sPeer', $object_model); if (!class_exists($peer)) { throw new Exception(sprintf('Unable to load class %s', $peer)); } $object = call_user_func(array($peer, 'retrieveByPk'), $object_id); if (is_null($object)) { throw new Exception(sprintf('Unable to retrieve %s with primary key %s', $object_model, $object_id)); } if (!sfPropelActAsStarredBehaviorToolkit::isStarred($object)) { throw new Exception(sprintf('Class %s does not have the starred behavior', $object_model)); } return $object; } catch (Exception $e) { return sfContext::getInstance()->getLogger()->log($e->getMessage()); } }