/** * Constructs a new instance for a model */ public function __construct($search, $instance) { parent::__construct($search); if ($search->getParameter('models')->get(get_class($instance), null) == null) { throw new sfLuceneIndexerException(sprintf('Model "%s" is not registered.', get_class($instance))); } $this->instance = $instance; }
/** * Constructs a new instance for a model */ public function __construct($search, $instance) { parent::__construct($search); $models = $search->getParameter('models')->getAll(); $this->model_name = false; if (!is_object($instance)) { throw new sfLuceneIndexerException('The instance is not an object'); } // fix class inheritance foreach (array_keys($models) as $model) { if ($instance instanceof $model) { $this->model_name = $model; break; } } if (!$this->model_name) { throw new sfLuceneIndexerException(sprintf('Model "%s" is not registered.', get_class($instance))); } $this->instance = $instance; }
/** * Retrives the guid for an action */ protected function getGuid($params) { return parent::getGuid($this->getUri($params)); }