/** * @see sfTask */ protected function execute($arguments = array(), $options = array()) { $databaseManager = new sfDatabaseManager($this->configuration); if ($this->configuration instanceof sfApplicationConfiguration && !$options['all']) { $this->sites = Doctrine_Core::getTable('sfSympalSite')->createQuery('s')->where('s.slug = ?', sfConfig::get('sf_app'))->execute(); } else { $this->sites = Doctrine_Core::getTable('sfSympalSite')->createQuery('s')->execute(); } foreach ($this->sites as $site) { $this->logSection('sympal', sprintf('Indexing models for site "%s"', sfConfig::get('sf_app'))); $search = sfSympalSearch::getInstance(); $models = sfSympalConfig::getSearchableModels(); foreach ($models as $model) { $records = Doctrine_Core::getTable($model)->findAll(); $this->logBlock(sprintf('Indexing "%s"', $model), 'INFO'); foreach ($records as $record) { $this->logBlock(sprintf('...%s (%s)', $record->getId(), (string) $record), 'COMMENT'); $search->updateSearchIndex($record); } } } }