DrawMyAttention\ResourceGenerator\Commands\ResourceMakeCommand::getFieldTypeFromProperties PHP Method

getFieldTypeFromProperties() private method

Get the column field type based from the properties of the field being created.
private getFieldTypeFromProperties ( array $properties ) : string
$properties array
return string
    private function getFieldTypeFromProperties($properties)
    {
        $type = array_intersect($properties, $this->dataTypes);
        // If the properties that were given in the command
        // do not explicitly define a data type, or there
        // is no matching data type found, the column
        // should be cast to a string.
        if (!$type) {
            return 'string';
        }
        return $type[0];
    }