LukePOLO\LaraCart\CartItem::setModel PHP Method

setModel() public method

Sets the related model to the item.
public setModel ( $itemModel, array $relations = [] )
$itemModel
$relations array
    public function setModel($itemModel, $relations = [])
    {
        if (!class_exists($itemModel)) {
            throw new ModelNotFound('Could not find relation model');
        }
        $this->itemModel = $itemModel;
        $this->itemModelRelations = $relations;
    }