src/Cart.php
public function restore()
    {
        $state = $this->store->get($this->id);

        if ($state == '') {
            return;
        }

        $data = @unserialize($state); // suppress unserializable error

        $this->restoreCheckType($data);
        $this->restoreCheckContents($data);
        $this->restoreCheckContentsType($data);

        $this->id = $data['id'];
        $this->items = [];

        foreach ($data['items'] as $itemArr) {
            $this->items[] = new CartItem($itemArr);
        }
    }
public function restore()
    {
        $state = $this->store->get($this->id);

        if ($state == '') {
            return;
        }

        $data = @unserialize($state); // suppress unserializable error

        $this->restoreCheckType($data);
        $this->restoreCheckContents($data);
        $this->restoreCheckContentsType($data);

        $this->id = $data['id'];
        $this->items = [];

        foreach ($data['items'] as $itemArr) {
            $this->items[] = new CartItem($itemArr);
        }
    }
public function restore ( ) { $ state = $ this -> store -> get ( $ this -> id ) ; if ( $ state == '' ) { return ; } $ data = @ unserialize ( $ state ) ; // suppress unserializable error $ this -> restoreCheckType ( $ data ) ; $ this -> restoreCheckContents ( $ data ) ; $ this -> restoreCheckContentsType ( $ data ) ; $ this -> id = $ data [ 'id' ] ; $ this -> items = [ ] ; foreach ( $ data [ 'items' ] as $ itemArr ) { $ this -> items [ ] = new CartItem ( $ itemArr ) ; } }
Restore the cart from its saved state.

@throws CartRestoreException
Restore the cart from its saved state .