Пример #1
0
 /**
  * Get an item from the array by offset
  *
  * @param   int     $offset The offset
  * @return  mixed   The item from the array
  */
 public function offsetGet($offset)
 {
     if (!parent::offsetExists($offset)) {
         $result = unserialize(apc_fetch($this->_namespace . '-' . $offset));
     } else {
         $result = parent::offsetGet($offset);
     }
     return $result;
 }
Пример #2
0
 /**
  * Get an item from the array by offset
  *
  * @param   int     $offset The offset
  * @return  mixed   The item from the array
  */
 public function offsetGet($offset)
 {
     if (!parent::offsetExists($offset)) {
         if ($data = apc_fetch($this->getNamespace() . '-object_' . $offset)) {
             $class = $data['class'];
             $identifier = $data['identifier'];
             //Set the identifier
             parent::offsetSet($offset, $identifier);
             //Set the class
             $this->setClass($offset, $class);
         }
     } else {
         $identifier = parent::offsetGet($offset);
     }
     return $identifier;
 }