SqlParser\Components\CreateDefinition::__construct PHP Method

__construct() public method

Constructor.
public __construct ( string $name = null, OptionsArray $options = null, DataType | Key $type = null, boolean $isConstraint = false, Reference $references = null )
$name string The name of the field.
$options OptionsArray The options of this field.
$type DataType | Key The data type of this field or the key.
$isConstraint boolean Whether this field is a constraint or not.
$references Reference References.
    public function __construct($name = null, $options = null, $type = null, $isConstraint = false, $references = null)
    {
        $this->name = $name;
        $this->options = $options;
        if ($type instanceof DataType) {
            $this->type = $type;
        } elseif ($type instanceof Key) {
            $this->key = $type;
            $this->isConstraint = $isConstraint;
            $this->references = $references;
        }
    }