public function store($identifier)
    {
        $content = $this->getContent();

        if ($this->storedCartWithIdentifierExists($identifier)) {
            throw new CartAlreadyStoredException("A cart with identifier {$identifier} was already stored.");
        }

        $this->getConnection()->table($this->getTableName())->insert([
            'identifier' => $identifier,
            'instance' => $this->currentInstance(),
            'content' => serialize($content)
        ]);

        $this->events->fire('cart.stored');
    }
public function store($identifier)
    {
        $content = $this->getContent();

        if ($this->storedCartWithIdentifierExists($identifier)) {
            throw new CartAlreadyStoredException("A cart with identifier {$identifier} was already stored.");
        }

        $this->getConnection()->table($this->getTableName())->insert([
            'identifier' => $identifier,
            'instance' => $this->currentInstance(),
            'content' => serialize($content)
        ]);

        $this->events->fire('cart.stored');
    }
public function store ( $ identifier ) { $ content = $ this -> getContent ( ) ; if ( $ this -> storedCartWithIdentifierExists ( $ identifier ) ) { throw new CartAlreadyStoredException ( "A cart with identifier {$identifier} was already stored." ) ; } $ this -> getConnection ( ) -> table ( $ this -> getTableName ( ) ) -> insert ( [ 'identifier' => $ identifier , 'instance' => $ this -> currentInstance ( ) , 'content' => serialize ( $ content ) ] ) ; $ this -> events -> fire ( 'cart.stored' ) ; }
Store an the current instance of the cart.

@param mixed $identifier
@return void
Store an the current instance of the cart .