Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
DbGenerator Class Reference

Public Member Functions

 isInt ($fieldType)
 
 __construct ()
 
 setDatabaseWrapper (AbstractDbWrapper $wrapper)
 
 setTablesToCreate (array $tables)
 
 createDatabase ($name)
 
 selectDatabase ($name)
 
 createTable ($name, $fieldsAttributes, $attributes=[])
 
 addKey ($tableName, $fieldNames, $type='PRIMARY')
 
 addForeignKey ($tableName, $fkFieldName, $referencesTableName, $referencesFieldName, $fkName=null, $onDelete='CASCADE', $onUpdate='NO ACTION')
 
 addAutoInc ($tableName, $fieldName, $fieldInfos, $value=1)
 
 addField ($tableName, $fieldName, $fieldAttributes)
 
 modifyField ($tableName, $fieldName, $fieldAttributes)
 
 generateField ($fieldAttributes, $forPk=false)
 
 getSqlScript ()
 
 addManyToMany ($jointableInfos, $targetEntity)
 
 generateManyToManys ()
 
 hasToCreateTable (string $table)
 
 getScript ()
 
 __toString ()
 
 setMigrationMode ($migrationMode)
 

Protected Member Functions

 addScript ($key, $script)
 
 addOrUpdateField ($tableName, $fieldName, $fieldAttributes, $part='addFieldMask')
 
 checkConstraintName ($name)
 
 checkFieldAttributes ($fieldAttributes, $forPk=false)
 
 generateFields ($fieldsAttributes)
 
 replaceMask ($key, $value, $mask)
 
 replaceArrayMask ($keyValues, $mask)
 
 generateManyToMany ($joinTable, $infos)
 

Protected Attributes

 $nameProtection
 
 $createDatabaseMask
 
 $createTableMask
 
 $fieldMask
 
 $foreignKeyMask
 
 $alterTableMask
 
 $alterTableAddKey
 
 $autoIncMask
 
 $selectDbMask
 
 $modifyFieldMask
 
 $addFieldMask
 
 $constraintNames = []
 
 $sqlScript = []
 
 $fieldTypes
 
 $defaultType
 
 $manyToManys = []
 
 $tablesToCreate
 
 $migrationMode
 

Detailed Description

Definition at line 21 of file DbGenerator.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Definition at line 63 of file DbGenerator.php.

Member Function Documentation

◆ __toString()

__toString ( )

Definition at line 325 of file DbGenerator.php.

◆ addAutoInc()

addAutoInc (   $tableName,
  $fieldName,
  $fieldInfos,
  $value = 1 
)

Definition at line 148 of file DbGenerator.php.

◆ addField()

addField (   $tableName,
  $fieldName,
  $fieldAttributes 
)

Definition at line 159 of file DbGenerator.php.

◆ addForeignKey()

addForeignKey (   $tableName,
  $fkFieldName,
  $referencesTableName,
  $referencesFieldName,
  $fkName = null,
  $onDelete = 'CASCADE',
  $onUpdate = 'NO ACTION' 
)

Definition at line 132 of file DbGenerator.php.

◆ addKey()

addKey (   $tableName,
  $fieldNames,
  $type = 'PRIMARY' 
)

Definition at line 119 of file DbGenerator.php.

◆ addManyToMany()

addManyToMany (   $jointableInfos,
  $targetEntity 
)

Definition at line 250 of file DbGenerator.php.

◆ addOrUpdateField()

addOrUpdateField (   $tableName,
  $fieldName,
  $fieldAttributes,
  $part = 'addFieldMask' 
)
protected

Definition at line 175 of file DbGenerator.php.

◆ addScript()

addScript (   $key,
  $script 
)
protected

Definition at line 167 of file DbGenerator.php.

◆ checkConstraintName()

checkConstraintName (   $name)
protected

Definition at line 185 of file DbGenerator.php.

◆ checkFieldAttributes()

checkFieldAttributes (   $fieldAttributes,
  $forPk = false 
)
protected

Definition at line 206 of file DbGenerator.php.

◆ createDatabase()

createDatabase (   $name)

Definition at line 98 of file DbGenerator.php.

◆ createTable()

createTable (   $name,
  $fieldsAttributes,
  $attributes = [] 
)

Definition at line 108 of file DbGenerator.php.

◆ generateField()

generateField (   $fieldAttributes,
  $forPk = false 
)

Definition at line 201 of file DbGenerator.php.

◆ generateFields()

generateFields (   $fieldsAttributes)
protected

Definition at line 225 of file DbGenerator.php.

◆ generateManyToMany()

generateManyToMany (   $joinTable,
  $infos 
)
protected

Definition at line 273 of file DbGenerator.php.

◆ generateManyToManys()

generateManyToManys ( )

Definition at line 258 of file DbGenerator.php.

◆ getScript()

getScript ( )

Definition at line 314 of file DbGenerator.php.

◆ getSqlScript()

getSqlScript ( )

Definition at line 246 of file DbGenerator.php.

◆ hasToCreateTable()

hasToCreateTable ( string  $table)

Definition at line 266 of file DbGenerator.php.

◆ isInt()

isInt (   $fieldType)

Definition at line 59 of file DbGenerator.php.

◆ modifyField()

modifyField (   $tableName,
  $fieldName,
  $fieldAttributes 
)

Definition at line 163 of file DbGenerator.php.

◆ replaceArrayMask()

replaceArrayMask (   $keyValues,
  $mask 
)
protected

Definition at line 239 of file DbGenerator.php.

◆ replaceMask()

replaceMask (   $key,
  $value,
  $mask 
)
protected

Definition at line 233 of file DbGenerator.php.

◆ selectDatabase()

selectDatabase (   $name)

Definition at line 103 of file DbGenerator.php.

◆ setDatabaseWrapper()

setDatabaseWrapper ( AbstractDbWrapper  $wrapper)

Definition at line 79 of file DbGenerator.php.

◆ setMigrationMode()

setMigrationMode (   $migrationMode)
Parameters
mixed$migrationMode

Definition at line 336 of file DbGenerator.php.

◆ setTablesToCreate()

setTablesToCreate ( array  $tables)

Definition at line 94 of file DbGenerator.php.

Field Documentation

◆ $addFieldMask

$addFieldMask
protected

Definition at line 43 of file DbGenerator.php.

◆ $alterTableAddKey

$alterTableAddKey
protected

Definition at line 35 of file DbGenerator.php.

◆ $alterTableMask

$alterTableMask
protected

Definition at line 33 of file DbGenerator.php.

◆ $autoIncMask

$autoIncMask
protected

Definition at line 37 of file DbGenerator.php.

◆ $constraintNames

$constraintNames = []
protected

Definition at line 45 of file DbGenerator.php.

◆ $createDatabaseMask

$createDatabaseMask
protected

Definition at line 25 of file DbGenerator.php.

◆ $createTableMask

$createTableMask
protected

Definition at line 27 of file DbGenerator.php.

◆ $defaultType

$defaultType
protected

Definition at line 51 of file DbGenerator.php.

◆ $fieldMask

$fieldMask
protected

Definition at line 29 of file DbGenerator.php.

◆ $fieldTypes

$fieldTypes
protected

Definition at line 49 of file DbGenerator.php.

◆ $foreignKeyMask

$foreignKeyMask
protected

Definition at line 31 of file DbGenerator.php.

◆ $manyToManys

$manyToManys = []
protected

Definition at line 53 of file DbGenerator.php.

◆ $migrationMode

$migrationMode
protected

Definition at line 57 of file DbGenerator.php.

◆ $modifyFieldMask

$modifyFieldMask
protected

Definition at line 41 of file DbGenerator.php.

◆ $nameProtection

$nameProtection
protected

Definition at line 23 of file DbGenerator.php.

◆ $selectDbMask

$selectDbMask
protected

Definition at line 39 of file DbGenerator.php.

◆ $sqlScript

$sqlScript = []
protected

Definition at line 47 of file DbGenerator.php.

◆ $tablesToCreate

$tablesToCreate
protected

Definition at line 55 of file DbGenerator.php.


The documentation for this class was generated from the following file: