League\FactoryMuffin\Stores\AbstractStore::persist PHP Method

persist() public method

Save the model to the database.
public persist ( object $model ) : void
$model object The model instance.
return void
    public function persist($model)
    {
        if (!$this->save($model)) {
            if (isset($model->validationErrors) && $model->validationErrors) {
                throw new SaveFailedException(get_class($model), $model->validationErrors);
            }
            throw new SaveFailedException(get_class($model));
        }
        if (!$this->isSaved($model)) {
            $this->markSaved($model);
        }
    }