Sleimanx2\Plastic\Mappings\Mapping::prepareModel PHP 메소드

prepareModel() 보호된 메소드

Validate the given model and create a new instance.
protected prepareModel ( )
    protected function prepareModel()
    {
        if (!$this->model) {
            throw new MissingArgumentException('model property should be filled');
        }
        $this->model = new $this->model();
        $traits = class_uses($this->model);
        if (!isset($traits[Searchable::class])) {
            throw new InvalidArgumentException(get_class($this->model) . ' does not use the searchable trait');
        }
    }