League\FactoryMuffin\Stores\StoreInterface::persist PHP Méthode

persist() public méthode

Save the model to the database.
public persist ( object $model ) : void
$model object The model instance.
Résultat void
    public function persist($model);

Usage Example

 /**
  * Creates and saves a model.
  *
  * @param string $name The model definition name.
  * @param array  $attr The model attributes.
  *
  * @return object
  */
 public function create($name, array $attr = [])
 {
     $model = $this->make($name, $attr, true);
     $this->store->persist($model);
     if ($this->triggerCallback($model, $name)) {
         $this->store->persist($model);
     }
     return $model;
 }