original_string: public function restore($identifier)
      {
          if( ! $this->storedCartWithIdentifierExists($identifier)) {
              return;
          }
  
          $stored = $this->getConnection()->table($this->getTableName())
              ->where('identifier', $identifier)->first();
  
          $storedContent = unserialize($stored->content);
  
          $currentInstance = $this->currentInstance();
  
          $this->instance($stored->instance);
  
          $content = $this->getContent();
  
          foreach ($storedContent as $cartItem) {
              $content->put($cartItem->rowId, $cartItem);
          }
  
          $this->events->fire('cart.restored');
  
          $this->session->put($this->instance, $content);
  
          $this->instance($currentInstance);
  
          $this->getConnection()->table($this->getTableName())
              ->where('identifier', $identifier)->delete();
      }
code: public function restore($identifier)
      {
          if( ! $this->storedCartWithIdentifierExists($identifier)) {
              return;
          }
  
          $stored = $this->getConnection()->table($this->getTableName())
              ->where('identifier', $identifier)->first();
  
          $storedContent = unserialize($stored->content);
  
          $currentInstance = $this->currentInstance();
  
          $this->instance($stored->instance);
  
          $content = $this->getContent();
  
          foreach ($storedContent as $cartItem) {
              $content->put($cartItem->rowId, $cartItem);
          }
  
          $this->events->fire('cart.restored');
  
          $this->session->put($this->instance, $content);
  
          $this->instance($currentInstance);
  
          $this->getConnection()->table($this->getTableName())
              ->where('identifier', $identifier)->delete();
      }
code_tokens: public function restore ( $ identifier ) { if ( ! $ this -> storedCartWithIdentifierExists ( $ identifier ) ) { return ; } $ stored = $ this -> getConnection ( ) -> table ( $ this -> getTableName ( ) ) -> where ( 'identifier' , $ identifier ) -> first ( ) ; $ storedContent = unserialize ( $ stored -> content ) ; $ currentInstance = $ this -> currentInstance ( ) ; $ this -> instance ( $ stored -> instance ) ; $ content = $ this -> getContent ( ) ; foreach ( $ storedContent as $ cartItem ) { $ content -> put ( $ cartItem -> rowId , $ cartItem ) ; } $ this -> events -> fire ( 'cart.restored' ) ; $ this -> session -> put ( $ this -> instance , $ content ) ; $ this -> instance ( $ currentInstance ) ; $ this -> getConnection ( ) -> table ( $ this -> getTableName ( ) ) -> where ( 'identifier' , $ identifier ) -> delete ( ) ; }
docstring: Restore the cart with the given identifier.
  
  @param mixed $identifier
  @return void
docstring_tokens: Restore the cart with the given identifier .