Isswp101\Persimmon\Traits\Mergeable::merge PHP Method

merge() public static method

Merge models.
public static merge ( Model $model1, Model $model2, array $attributes ) : Model
$model1 Isswp101\Persimmon\Model
$model2 Isswp101\Persimmon\Model
$attributes array
return Isswp101\Persimmon\Model
    public static function merge(Model $model1, Model $model2, array $attributes)
    {
        foreach ($attributes as $attribute) {
            $model1->{$attribute} = $model2->{$attribute};
        }
        return $model1;
    }
Mergeable