class Database extends ScopedMappingModel
A class for holding application data structures.
Constants
DEFAULT_STRING_FORMAT |
|
Methods
__construct(string $name = null)
Constructs a new Database object. |
||
string |
getNamespace()
Returns the namespace. |
from ScopedMappingModel |
setNamespace(string $namespace)
Sets the namespace. |
from ScopedMappingModel | |
boolean |
isAbsoluteNamespace(string $namespace)
Returns whether or not the namespace is absolute. |
from ScopedMappingModel |
string |
getPackage()
Returns the package name. |
from ScopedMappingModel |
setPackage(string $package)
Sets the package name. |
from ScopedMappingModel | |
string |
getSchema()
Returns the schema name. |
from ScopedMappingModel |
setSchema(string $schema)
Sets the schema name. |
from ScopedMappingModel | |
PlatformInterface |
getPlatform()
Returns the PlatformInterface implementation for this database. |
|
setPlatform(PlatformInterface $platform = null)
Sets the PlatformInterface implementation for this database. |
||
string |
getName()
Returns the database name. |
|
setName(string $name)
Sets the database name. |
||
string |
getBaseClass()
Returns the name of the base super class inherited by active record objects. |
|
setBaseClass($class)
Sets the name of the base super class inherited by active record objects. |
||
string |
getDefaultIdMethod()
Returns the name of the default ID method strategy. |
|
setDefaultIdMethod(string $strategy)
Sets the name of the default ID method strategy. |
||
string |
getDefaultPhpNamingMethod()
Returns the name of the default PHP naming method strategy, which specifies the method for converting schema names for table and column to PHP names. |
|
setDefaultPhpNamingMethod(string $strategy)
Sets name of the default PHP naming method strategy. |
||
static array |
getSupportedStringFormats()
Returns the list of supported string formats |
|
setDefaultStringFormat(string $format)
Sets the default string format for ActiveRecord objects in this table. |
||
string |
getDefaultStringFormat()
Returns the default string format for ActiveRecord objects in this table. |
|
boolean |
isHeavyIndexing()
Returns whether or not heavy indexing is enabled. |
|
boolean |
getHeavyIndexing()
Returns whether or not heavy indexing is enabled. |
|
setHeavyIndexing(boolean $heavyIndexing)
Sets whether or not heavy indexing is enabled. |
||
array |
getTables()
Return the list of all tables. |
|
integer |
countTables()
Return the number of tables in the database. |
|
array |
getTablesForSql()
Returns the list of all tables that have a SQL representation. |
|
boolean |
hasTable(string $name, boolean $caseInsensitive = false)
Returns whether or not the database has a table. |
|
Table |
getTable(string $name, boolean $caseInsensitive = false)
Returns the table with the specified name. |
|
boolean |
hasTableByPhpName(string $phpName)
Returns whether or not the database has a table identified by its PHP name. |
|
Table |
getTableByPhpName(string $phpName)
Returns the table object with the specified PHP name. |
|
Table |
addTable(Table|array $table)
Adds a new table to this database. |
|
setParentSchema(Schema $parent)
Sets the parent schema |
||
Schema |
getParentSchema()
Returns the parent schema |
|
Domain |
addDomain(Domain|array $data)
Adds a domain object to this database. |
|
Domain |
getDomain(string $name)
Returns the already configured domain object by its name. |
|
GeneratorConfigInterface |
getGeneratorConfig()
Returns the GeneratorConfigInterface object. |
|
string |
getBuildProperty(string $name)
Returns the build property identified by its name. |
|
Behavior |
addBehavior(Behavior|array $bdata)
Adds a new behavior to the database* |
|
array |
getBehaviors()
Returns the list of all database behaviors. |
|
boolean |
hasBehavior(string $name)
Returns whether or not the database has a specific behavior. |
|
Behavior |
getBehavior(string $name)
Returns the corresponding behavior identified by its name. |
|
string |
getTablePrefix()
Returns the table prefix for this database. |
|
Behavior |
getNextTableBehavior()
Returns the next behavior on all tables, ordered by behavior priority, and skipping the ones that were already executed. |
|
doFinalInitialization()
Finalizes the setup process. |
||
appendXml(DOMNode $node) |
Details
at line 55
public
__construct(string $name = null)
Constructs a new Database object.
in ScopedMappingModel at line 57
public string
getNamespace()
Returns the namespace.
in ScopedMappingModel at line 67
public
setNamespace(string $namespace)
Sets the namespace.
in ScopedMappingModel at line 90
public boolean
isAbsoluteNamespace(string $namespace)
Returns whether or not the namespace is absolute.
A namespace is absolute if it starts with a "\".
in ScopedMappingModel at line 100
public string
getPackage()
Returns the package name.
in ScopedMappingModel at line 110
public
setPackage(string $package)
Sets the package name.
in ScopedMappingModel at line 125
public string
getSchema()
Returns the schema name.
in ScopedMappingModel at line 135
public
setSchema(string $schema)
Sets the schema name.
at line 94
public PlatformInterface
getPlatform()
Returns the PlatformInterface implementation for this database.
at line 104
public
setPlatform(PlatformInterface $platform = null)
Sets the PlatformInterface implementation for this database.
at line 114
public string
getName()
Returns the database name.
at line 124
public
setName(string $name)
Sets the database name.
at line 135
public string
getBaseClass()
Returns the name of the base super class inherited by active record objects.
This parameter is overridden at the table level.
at line 146
public
setBaseClass($class)
Sets the name of the base super class inherited by active record objects.
This parameter is overridden at the table level.
at line 157
public string
getDefaultIdMethod()
Returns the name of the default ID method strategy.
This parameter can be overridden at the table level.
at line 168
public
setDefaultIdMethod(string $strategy)
Sets the name of the default ID method strategy.
This parameter can be overridden at the table level.
at line 180
public string
getDefaultPhpNamingMethod()
Returns the name of the default PHP naming method strategy, which specifies the method for converting schema names for table and column to PHP names.
This parameter can be overridden at the table layer.
at line 190
public
setDefaultPhpNamingMethod(string $strategy)
Sets name of the default PHP naming method strategy.
at line 200
static public array
getSupportedStringFormats()
Returns the list of supported string formats
at line 214
public
setDefaultStringFormat(string $format)
Sets the default string format for ActiveRecord objects in this table.
This parameter can be overridden at the table level.
Any of 'XML', 'YAML', 'JSON', or 'CSV'.
at line 232
public string
getDefaultStringFormat()
Returns the default string format for ActiveRecord objects in this table.
This parameter can be overridden at the table level.
at line 244
public boolean
isHeavyIndexing()
Returns whether or not heavy indexing is enabled.
This is an alias for getHeavyIndexing().
at line 256
public boolean
getHeavyIndexing()
Returns whether or not heavy indexing is enabled.
This is an alias for isHeavyIndexing().
at line 266
public
setHeavyIndexing(boolean $heavyIndexing)
Sets whether or not heavy indexing is enabled.
at line 276
public array
getTables()
Return the list of all tables.
at line 286
public integer
countTables()
Return the number of tables in the database.
at line 303
public array
getTablesForSql()
Returns the list of all tables that have a SQL representation.
at line 322
public boolean
hasTable(string $name, boolean $caseInsensitive = false)
Returns whether or not the database has a table.
at line 338
public Table
getTable(string $name, boolean $caseInsensitive = false)
Returns the table with the specified name.
at line 358
public boolean
hasTableByPhpName(string $phpName)
Returns whether or not the database has a table identified by its PHP name.
at line 369
public Table
getTableByPhpName(string $phpName)
Returns the table object with the specified PHP name.
at line 384
public Table
addTable(Table|array $table)
Adds a new table to this database.
at line 452
public
setParentSchema(Schema $parent)
Sets the parent schema
at line 462
public Schema
getParentSchema()
Returns the parent schema
at line 473
public Domain
addDomain(Domain|array $data)
Adds a domain object to this database.
at line 496
public Domain
getDomain(string $name)
Returns the already configured domain object by its name.
at line 510
public GeneratorConfigInterface
getGeneratorConfig()
Returns the GeneratorConfigInterface object.
at line 525
public string
getBuildProperty(string $name)
Returns the build property identified by its name.
at line 540
public Behavior
addBehavior(Behavior|array $bdata)
Adds a new behavior to the database*
at line 562
public array
getBehaviors()
Returns the list of all database behaviors.
at line 573
public boolean
hasBehavior(string $name)
Returns whether or not the database has a specific behavior.
at line 584
public Behavior
getBehavior(string $name)
Returns the corresponding behavior identified by its name.
at line 598
public string
getTablePrefix()
Returns the table prefix for this database.
at line 609
public Behavior
getNextTableBehavior()
Returns the next behavior on all tables, ordered by behavior priority, and skipping the ones that were already executed.
at line 633
public
doFinalInitialization()
Finalizes the setup process.