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(); $deleted = PluginTagTable::purgeOrphans(); $count = count($deleted); echo "deleted {$count} orphan tags.\n"; }
/** * DOCUMENT ME * @param sfWebRequest $request */ public function executeClean(sfWebRequest $request) { $deleted = PluginTagTable::purgeOrphans(); $count = count($deleted); $this->getUser()->setFlash('notice', "{$count} unused tags removed."); $this->redirect('a_tag_admin'); }