addOptions(array( new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'), // add your own options here )); $this->namespace = 'lucene'; $this->name = 'refresh'; $this->briefDescription = ''; } protected function execute($arguments = array(), $options = array()) { // initialize the database connection $databaseManager = new sfDatabaseManager($this->configuration); $connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection(); // $cards = Doctrine::getTable('Card')->findAll(); // foreach($cards as $card) // { // $card->updateLuceneIndex(); // $this->logSection('Card', $card->getId()); // } /* $attachments = Doctrine::getTable('Attachment')->findAll(); foreach($attachments as $attachment) { $attachment->updateLuceneIndex(); $this->logSection('Attachment', $attachment->getId()); }*/ $regals = Doctrine::getTable('Regal')->findAll(); foreach($regals as $regal) { $regal->updateLuceneIndex(); $this->logSection('Regal', $regal->getId()); } $messages = Doctrine::getTable('Message')->findAll(); foreach($messages as $message) { $message->updateLuceneIndex(); $this->logSection('Message', $message->getId()); } } }