Пример #1
0
 /**
  * Set the session data from an array
  *
  * @param array $arrData The session data
  *
  * @throws \Exception If $arrData is not an array
  */
 public function setData($arrData)
 {
     @trigger_error('Using Session::setData() has been deprecated and will no longer work in Contao 5.0. Use the Symfony session via the container instead.', E_USER_DEPRECATED);
     if (!is_array($arrData)) {
         throw new \Exception('Array required to set session data');
     }
     // Map the referer (see #281)
     if (isset($data['referer'])) {
         $this->session->set('referer', $data['referer']);
         unset($data['referer']);
     }
     $this->sessionBag->replace($arrData);
 }
Пример #2
0
 /**
  * Set the session data from an array
  *
  * @param array $arrData The session data
  *
  * @throws \Exception If $arrData is not an array
  */
 public function setData($arrData)
 {
     if (!is_array($arrData)) {
         throw new \Exception('Array required to set session data');
     }
     // Map the referer (see #281)
     foreach ($this->mappedKeys as $strKey) {
         if (isset($data[$strKey])) {
             $this->session->set($strKey, $data[$strKey]);
             unset($data[$strKey]);
         }
     }
     $this->sessionBag->replace($arrData);
 }