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();
    }
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();
    }
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 ( ) ; }
Restore the cart with the given identifier.

@param mixed $identifier
@return void
Restore the cart with the given identifier .