LazyRecord\Schema\DynamicSchemaDeclare::__construct PHP Метод

__construct() публичный Метод

public __construct ( $model = null )
    public function __construct($model = null)
    {
        if ($model) {
            if (is_object($model)) {
                $this->model = $model;
                $this->modelClass = get_class($model);
            } elseif (is_string($model)) {
                $this->modelClass = $model;
                $this->model = new $model();
            }
            $this->model->schema($this);
            $this->build();
        }
    }