LMongo\Eloquent\Model::replicate PHP 메소드

replicate() 공개 메소드

Clone the model into a new, non-existing instance.
public replicate ( ) : Model
리턴 Model
    public function replicate()
    {
        $attributes = array_except($this->attributes, array($this->getKeyName()));
        with($instance = new static())->setRawAttributes($attributes);
        return $instance->setRelations($this->relations);
    }
Model