/** * Retrives the repository type and the repository object. */ public function preExecute() { $this->type = $this->getRequest()->getPostParameter('rep', sfConfig::get('app_repository_type')); $repository_factory = RepositoryFactory::init(); $this->repository = $repository_factory->build($this->type, sfConfig::get('app_repository_' . $this->type)); $log_command_factory = LogCommandFactory::init(); $this->log_command = $log_command_factory->build($this->type); }
/** * initalize the factory class * * @return LogCommandFactory */ public static function init() { $class = __CLASS__; return self::$instance = new $class(); }