Esempio n. 1
0
 /**
  * Dispatch observer default behavior.
  * This dispatches the data and the stored translator instance to render().
  *
  * @param Doozr_Base_Presenter $subject The subject to retrieve data from
  *
  * @author Benjamin Carl <*****@*****.**>
  *
  * @return bool TRUE on success, otherwise FALSE
  */
 protected function __update(Doozr_Base_Presenter $subject)
 {
     return $this->setData($subject->getData());
 }
Esempio n. 2
0
 /**
  * Constructor.
  *
  * @param Doozr_Registry                $registry      Instance of Doozr_Registry containing all core components
  * @param Doozr_Base_State_Interface    $requestState  The whole request as processed by "Route"
  * @param array                         $request       The request
  * @param array                         $translation   The translation required to read the request
  * @param Doozr_Configuration_Interface $configuration The Doozr main configuration instance
  * @param Doozr_Base_Model              $model         The model to communicate with backend (db)
  * @param Doozr_Base_View               $view          The view to display results
  *
  * @author Benjamin Carl <*****@*****.**>
  *
  * @return \Doozr_Base_Presenter_Rest
  */
 public function __construct(Doozr_Registry $registry, Doozr_Base_State_Interface $requestState, array $request, array $translation, Doozr_Configuration_Interface $configuration = null, Doozr_Base_Model $model = null, Doozr_Base_View $view = null)
 {
     // We need to hook in here - to make use of this proxy for installing JsonResponseHandler ;)
     /*
     $whoops = new Whoops\Run();
     $jsonErrorHandler = new Whoops\Handler\JsonResponseHandler();
     #$jsonErrorHandler->onlyForAjaxRequests(true);
     $whoops->pushHandler($jsonErrorHandler);
     $whoops->register();
     */
     // Forward (proxy) to parent
     parent::__construct($registry, $requestState, $request, $translation, $configuration, $model, $view);
 }