/** * Executes this filter. * * @param sfFilterChain $filter_chain The filter chain */ public function execute(sfFilterChain $filter_chain) { $action_instance = $this->context->getController()->getActionStack()->getLastEntry()->getActionInstance(); // Keep track only of trackable actions if ($this->isTrackable($action_instance)) { try { $entry = ncTrackerEntryPeer::createFromAction($action_instance); $this->log('Created a new ncTrackerEntry.'); } catch (PropelException $exception) { $this->log( sprintf('Unable to create a new ncTrackerEntry. Error message: %s.', $exception->getMessage()) ); } } else { $this->log( sprintf('Ignored non-trackable action: %s/%s.', $action_instance->getModuleName(), $action_instance->getActionName()) ); } $filter_chain->execute($filter_chain); }
/** * Get all the different values set to $column. * * @param string $column The column from this class' table. * @param PropelPDO $con Optional PDO object. * @return array */ static public function retrieveAllValuesForColumn($column, PropelPDO $con = null) { $criteria = new Criteria(); $criteria->setDistinct(); $criteria->clearSelectColumns(); $criteria->addSelectColumn($column); return ncTrackerEntryPeer::doSelectStmt($criteria) ->fetchAll(PDO::FETCH_COLUMN); }
protected function getActionChoices() { if (null === $this->action_names) { $action_names = ncTrackerEntryPeer::retrieveAllValuesForColumn(ncTrackerEntryPeer::ACTION_NAME); $this->action_names = array('' => ''); if (count($action_names) > 0) { $this->action_names = $this->action_names + array_combine($action_names, $action_names); } } return $this->action_names; }