/** * @see ckAbstractResultAdapter::getResult() */ public function getResult(sfAction $action) { $lastStackEntry = $action->getContext()->getActionStack()->getLastEntry(); if ($lastStackEntry->getActionInstance() !== $action) { throw new sfRenderException(); } return $lastStackEntry->getPresentation(); }
/** * constractor * * @param sfAction $action * @param string $contentType */ public function __construct(sfAction $action) { $this->action = $action; $configcache = $action->getContext()->getConfiguration()->getConfigCache(); $file = 'config/op_opensocial_mobile_rewrite_url.yml'; $configcache->registerConfigHandler($file, 'sfSimpleYamlConfigHandler'); $this->rewriteUrlConfig = (include $configcache->checkConfig($file)); }
private function getUserIdFromAction(sfAction $action) { $user = $action->getContext()->getUser(); if (null === $user || (method_exists($user, 'isAuthenticated') && !$user->isAuthenticated())) { $user_id = self::ANONYMOUS; } else { $user_id = $user->getUsername(); } return $user_id ? $user_id : self::ANONYMOUS; }