PHP Class Xethron\MigrationsGenerator\Generators\FieldGenerator

Show file Open project: xethron/migrations-generator Class Usage Examples

Protected Properties

Property Type Description
$database string
$fieldTypeMap array Convert dbal types to Laravel Migration Types

Public Methods

Method Description
generate ( string $table, Doctrine\DBAL\Schema\AbstractSchemaManager $schema, string $database, boolean $ignoreIndexNames ) : array | boolean Create array of all the fields for a table

Protected Methods

Method Description
argsToString ( string | array $args, string $quotes = ''' ) : string
decorate ( string $function, string | array $args, string $quotes = ''' ) : string Get Decorator
getDefault ( string $default, string &$type ) : string
getEnum ( string $table ) : array Return all enum columns for a given table
getFields ( Doctrine\DBAL\Schema\Column[] $columns, Xethron\MigrationsGenerator\Generators\IndexGenerator $indexGenerator ) : array
getLength ( integer $length ) : integer | void
getMultiFieldIndexes ( Xethron\MigrationsGenerator\Generators\IndexGenerator $indexGenerator ) : array
getPrecision ( integer $precision, integer $scale ) : string | void
setEnum ( array $fields, string $table ) : array

Method Details

argsToString() protected method

protected argsToString ( string | array $args, string $quotes = ''' ) : string
$args string | array
$quotes string
return string

decorate() protected method

Get Decorator
protected decorate ( string $function, string | array $args, string $quotes = ''' ) : string
$function string
$args string | array
$quotes string
return string

generate() public method

Create array of all the fields for a table
public generate ( string $table, Doctrine\DBAL\Schema\AbstractSchemaManager $schema, string $database, boolean $ignoreIndexNames ) : array | boolean
$table string Table Name
$schema Doctrine\DBAL\Schema\AbstractSchemaManager
$database string
$ignoreIndexNames boolean
return array | boolean

getDefault() protected method

protected getDefault ( string $default, string &$type ) : string
$default string
$type string
return string

getEnum() protected method

Return all enum columns for a given table
protected getEnum ( string $table ) : array
$table string
return array

getFields() protected method

protected getFields ( Doctrine\DBAL\Schema\Column[] $columns, Xethron\MigrationsGenerator\Generators\IndexGenerator $indexGenerator ) : array
$columns Doctrine\DBAL\Schema\Column[]
$indexGenerator Xethron\MigrationsGenerator\Generators\IndexGenerator
return array

getLength() protected method

protected getLength ( integer $length ) : integer | void
$length integer
return integer | void

getMultiFieldIndexes() protected method

protected getMultiFieldIndexes ( Xethron\MigrationsGenerator\Generators\IndexGenerator $indexGenerator ) : array
$indexGenerator Xethron\MigrationsGenerator\Generators\IndexGenerator
return array

getPrecision() protected method

protected getPrecision ( integer $precision, integer $scale ) : string | void
$precision integer
$scale integer
return string | void

setEnum() protected method

protected setEnum ( array $fields, string $table ) : array
$fields array
$table string
return array

Property Details

$database protected property

protected string $database
return string

$fieldTypeMap protected property

Convert dbal types to Laravel Migration Types
protected array $fieldTypeMap
return array