protected function createFromArray($array)
    {
        $this->id = $array['id'];
        $this->modelType = $array['modelType'];
        $this->modelId = $array['modelId'];
        $this->name = $array['name'];
        $this->price = $array['price'];
        $this->image = $array['image'];
        $this->quantity = $array['quantity'];

        return $this;
    }
protected function createFromArray($array)
    {
        $this->id = $array['id'];
        $this->modelType = $array['modelType'];
        $this->modelId = $array['modelId'];
        $this->name = $array['name'];
        $this->price = $array['price'];
        $this->image = $array['image'];
        $this->quantity = $array['quantity'];

        return $this;
    }
protected function createFromArray ( $ array ) { $ this -> id = $ array [ 'id' ] ; $ this -> modelType = $ array [ 'modelType' ] ; $ this -> modelId = $ array [ 'modelId' ] ; $ this -> name = $ array [ 'name' ] ; $ this -> price = $ array [ 'price' ] ; $ this -> image = $ array [ 'image' ] ; $ this -> quantity = $ array [ 'quantity' ] ; return $ this ; }
Creates a new cart item from an array.

@param array
@return \Freshbitsweb\LaravelCartManager\Core\CartItem
Creates a new cart item from an array .