namespace = 'search'; $this->name = 'update-index'; $this->addOption('env', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'prod'); } protected function execute($arguments = array(), $options = array()) { $databaseManager = new sfDatabaseManager($this->configuration); $pagesArr = Doctrine::getTable('Page')->findAll(); echo "Pages: ".count($pagesArr)."\n";flush(); foreach($pagesArr AS $page) { $page->updateLuceneIndex(); } $equipmentArr = Doctrine::getTable('Equipment')->findAll(); echo "Equipment: ".count($equipmentArr)."\n";flush(); foreach($equipmentArr AS $equipment) { $equipment->updateLuceneIndex(); } $productArr = Doctrine::getTable('Product')->findAll(); echo "Product: ".count($productArr)."\n";flush(); foreach($productArr AS $product) { $product->updateLuceneIndex(); } } }