original_string: public function restore( $id, $attributes = array(), $search = false )
      {
          $metaStorage = $this->getMetaDataStorage();
          $metaStorage->lock();
  
          $metaData = $this->getMetaData( $metaStorage );
  
          $item = false;
          foreach ( $this->storageStack as $storageConf )
          {
              $item = call_user_func(
                  array(
                      $this->properties['options']->replacementStrategy,
                      'restore'
                  ),
                  $storageConf,
                  $metaData,
                  $id,
                  $attributes,
                  $search
              );
              if ( $item !== false )
              {
                  if ( $this->properties['options']->bubbleUpOnRestore )
                  {
                      $this->bubbleUp( $id, $attributes, $item, $storageConf, $metaData );
                  }
                  // Found, so end.
                  break;
              }
          }
  
          $metaStorage->storeMetaData( $metaData );
          $metaStorage->unlock();
  
          return $item;
      }
code: public function restore( $id, $attributes = array(), $search = false )
      {
          $metaStorage = $this->getMetaDataStorage();
          $metaStorage->lock();
  
          $metaData = $this->getMetaData( $metaStorage );
  
          $item = false;
          foreach ( $this->storageStack as $storageConf )
          {
              $item = call_user_func(
                  array(
                      $this->properties['options']->replacementStrategy,
                      'restore'
                  ),
                  $storageConf,
                  $metaData,
                  $id,
                  $attributes,
                  $search
              );
              if ( $item !== false )
              {
                  if ( $this->properties['options']->bubbleUpOnRestore )
                  {
                      $this->bubbleUp( $id, $attributes, $item, $storageConf, $metaData );
                  }
                  // Found, so end.
                  break;
              }
          }
  
          $metaStorage->storeMetaData( $metaData );
          $metaStorage->unlock();
  
          return $item;
      }
code_tokens: public function restore ( $ id , $ attributes = array ( ) , $ search = false ) { $ metaStorage = $ this -> getMetaDataStorage ( ) ; $ metaStorage -> lock ( ) ; $ metaData = $ this -> getMetaData ( $ metaStorage ) ; $ item = false ; foreach ( $ this -> storageStack as $ storageConf ) { $ item = call_user_func ( array ( $ this -> properties [ 'options' ] -> replacementStrategy , 'restore' ) , $ storageConf , $ metaData , $ id , $ attributes , $ search ) ; if ( $ item !== false ) { if ( $ this -> properties [ 'options' ] -> bubbleUpOnRestore ) { $ this -> bubbleUp ( $ id , $ attributes , $ item , $ storageConf , $ metaData ) ; } // Found, so end. break ; } } $ metaStorage -> storeMetaData ( $ metaData ) ; $ metaStorage -> unlock ( ) ; return $ item ; }
docstring: Restores an item from the stack.
  
  This method tries to restore an item from the cache stack and returns
  the found data, if any. If no data is found, boolean false is returned.
  Given the ID of an object will restore exactly the desired object. If
  additional $attributes are given, this may speed up the restore process
  for some caches. If only attributes are given, the $search parameter
  makes sense, since it will instruct the inner cach storages to search
  their content for the given attribute combination and will restore the
  first item found. However, this process is much slower then restoring
  with an ID and therefore is not recommended.
  
  @param string $id
  @param array $attributes
  @param bool $search
  @return mixed The restored data or false on failure.
docstring_tokens: Restores an item from the stack .