Example #1
0
 /**
  * Checks if $key exists.
  * @param  mixed  key or index
  * @return bool
  */
 public function offsetExists($key)
 {
     if (is_int($key)) {
         return (bool) current(array_slice((array) $this, $key, 1));
     }
     return parent::offsetExists($key);
 }
Example #2
0
 public function offsetExists($key)
 {
     if (is_int($key)) {
         $arr = array_values((array) $this);
         return isset($arr[$key]);
     }
     return parent::offsetExists($key);
 }
Example #3
0
 private function value($key, \Nette\ArrayHash $arr)
 {
     return $arr->offsetExists($key) ? $arr->offsetGet($key) : '';
 }