Example #1
0
 /**
  * Used inside while() clause for looping array data for $key
  */
 public function eachKey($key)
 {
     if (!empty($key)) {
         if (isset($this->_each[$key]) !== true) {
             $list = $this->getKey($key, []);
             $this->_each[$key] = is_array($list) ? array_values($list) : [];
         }
         if ($item = array_shift($this->_each[$key])) {
             if (is_array($item)) {
                 $registry = new Registry();
                 $registry->useData($item);
                 return $registry;
             }
             return $item;
         }
         unset($this->_each[$key]);
     }
     return false;
 }