Exemple #1
0
 static function createFromGlobals(Request $request, Session $session)
 {
     $viewState = new ViewState();
     $data = array();
     if ($request->request->has(self::REQUEST_PARAM_NAME)) {
         $data = unserialize(urldecode($request->request->get(self::REQUEST_PARAM_NAME)));
     } elseif ($request->query->has(self::REQUEST_PARAM_NAME)) {
         if ($session->has($request->query->get(self::REQUEST_PARAM_NAME))) {
             $data = $session->get($request->query->get(self::REQUEST_PARAM_NAME));
         }
     }
     $viewState->setData($data);
     return $viewState;
 }
Exemple #2
0
 /**
  * Obtiene el View State inicializados con los valores del request
  * @return ViewState 
  */
 public function getViewState()
 {
     if (is_null($this->_viewState)) {
         $this->_viewState = ViewState::createFromGlobals($this->getRequest(), $this->get('session'));
     }
     return $this->_viewState;
 }
Exemple #3
0
 public function load(ViewState $viewState)
 {
     $this->viewState = $viewState;
     $this->trail = $viewState->get(self::STORAGE_PARAM_NAME);
 }