Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function has($property)
 {
     return $this->storage->has($property);
 }
Пример #2
0
 /**
  * Get all value filter
  *
  * @return array Array value filter when coder use function addFilter
  */
 public function getFilter()
 {
     $sessionBagKey = $this->_module . '_' . $this->_controller . '_' . $this->_action . '_filter';
     $filterSessionGlobal = new SessionBag('ZCMS_GB_FILTER');
     $filterSession = [];
     if ($filterSessionGlobal->has($sessionBagKey)) {
         $filterSession = $filterSessionGlobal->get($sessionBagKey);
     }
     if (count($this->_filterOptions)) {
         foreach ($this->_filterOptions as $key => $item) {
             if ($item['method'] == 'POST') {
                 $this->_filter[$key] = $this->request->getPost($key, $item['type']);
                 if ($this->_filter[$key] == null && $this->_filter[$key] !== $item['value']) {
                     if (array_key_exists($key, $filterSession) && $filterSession[$key] != null) {
                         $this->_filter[$key] = $filterSession[$key];
                     } else {
                         $this->_filter[$key] = $item['value'];
                     }
                 }
             } else {
                 $this->_filter[$key] = $this->request->getQuery($key, $item['type']);
                 if ($this->_filter[$key] == null && $this->_filter[$key] !== $item['value']) {
                     if (array_key_exists($key, $filterSession) && $filterSession[$key] != null) {
                         $this->_filter[$key] = $filterSession[$key];
                     } else {
                         $this->_filter[$key] = $item['value'];
                     }
                 }
             }
         }
     }
     $filterSessionGlobal->set($sessionBagKey, $this->_filter);
     return $this->_filter;
 }