Class: atkDb2DDL
Source Location: /db/class.atkdb2ddl.inc
Class atkDb2DDL
Method Summary
| The |
buildCreate() |
Build a CREATE TABLE query and return it as a string. |
| void |
buildField() |
Generate a string for a field, to be used inside a CREATE TABLE statement. |
| void |
loadMetaData() |
Set all table data at once using the given table meta data, retrieved using the metadata function of the db instance. |
| void |
setTableType() |
Sets the table type (for databases that support different table types). |
Methods
Build a CREATE TABLE query and return it as a string.
API Tags:
| Return: | CREATE TABLE query. |
Redefinition of:
- atkDDL::buildCreate()
- Build a CREATE TABLE query and return it as a string.
void buildField(
$name
$name, $generictype
$generictype, [$size
$size = 0], [$flags
$flags = 0], [$default
$default = NULL]
)
|
|
Generate a string for a field, to be used inside a CREATE TABLE statement.
This function tries to be generic, so it will work in the largest number of databases. Databases that won't work with this syntax, should override this method in the database specific ddl class.
Parameters:
|
$name |
$name: |
The name of the field |
|
$generictype |
$generictype: |
The datatype of the field (should be one of the generic types supported by ATK). |
|
$size |
$size: |
The size of the field (if appropriate) |
|
$flags |
$flags: |
The DDL_ flags for this field. |
|
$default |
$default: |
The default value to be used when inserting new rows. |
Redefinition of:
- atkDDL::buildField()
- Generate a string for a field, to be used inside a CREATE TABLE statement.
void getGenericType(
$type
)
|
|
Parameters:
Information Tags:
Redefinition of:
- atkDDL::getGenericType()
- Convert an database specific type to an ATK generic datatype.
void getType(
$generictype
)
|
|
Parameters:
Information Tags:
Redefinition of:
- atkDDL::getType()
- Convert an ATK generic datatype to a database specific type.
void loadMetaData(
$tablemeta
$tablemeta
)
|
|
Set all table data at once using the given table meta data, retrieved using the metadata function of the db instance.
Parameters:
|
$tablemeta |
$tablemeta: |
table meta data array |
Redefinition of:
- atkDDL::loadMetaData()
- Set all table data at once using the given table meta data, retrieved using the metadata function of the db instance.
void needsQuotes(
$generictype
)
|
|
Parameters:
Redefinition of:
- atkDDL::needsQuotes()
- Method to determine whether quotes are needed around the values for a given generic datatype.
void setTableType(
$type, string
$tableType
)
|
|
Sets the table type (for databases that support different table types).
Parameters:
|
string |
$tableType: |
|
|
|
$type: |
|