YANA 4 PHP Framework
Docs For Class StructureFile
database schema file
This wrapper class represents the structure of a database
Located in /includes/class_structurefile.php
Object | --InputStream | --SecureInputStream | --SecureFileStream | --SML | --StructureFile
Name | Type | Description |
---|---|---|
$filename | string |
Create a new instance of this class.
Name | Type | Description |
---|---|---|
$filename | string |
merges the contents of another file with the current structure
Name | Type | Description |
---|---|---|
$table | string | |
&$row | string | |
$is_insert |
Returns bool(true) if $row is valid and bool(false) otherwise.
Name | Type | Description |
---|---|---|
$table | string |
Returns a numeric array of all columns in $table. Issues an E_USER_NOTICE and returns an empty array, if $table does not exist in current structure file.
Name | Type | Description |
---|---|---|
$operation | string | one of select, insert, update, delete |
$table | string | |
$columns | array | (optional) |
Retrieves all "constraint" entries that apply to the given operation on the dataset and returns the results as an numeric array.
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns constant NULL (not bool(false)) if value is not specified. Use is_null($result) to test for existance, don't use empty($result).
Name | Type | Description |
---|---|---|
$table | string |
Returns an associative array of foreign keys. If $table is not a specified in the current structure file, then NULL is returned instead. If the table has no foreign keys, an empty array is returned.
Note that this operation is not case sensitive.
Name | Type | Description |
---|---|---|
$table | string |
Returns a numeric array of all columns in $table, that are marked with the option INDEX => true (which means, all columns that have an index).
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns the 'length' attribute of $column in $table. Returns int(0) if there is no $table, or the table has no column named $column, or the column does not have a 'length' attribute.
Name | Type | Description |
---|---|---|
$table | string |
Returns the name of the primary key column of $table as a lower-cased string. Returns NULL and issues an E_USER_WARNING if $table is not a listed table in the current structure file. Returns NULL and issues an E_USER_WARNING if there is no primary key for $table.
Returns the text of the source file containing the database structure as a string or bool(false) on error.
Name | Type | Description |
---|---|---|
$table | string | |
$foreignKey | string |
Returns a numeric array of all tables in the current structure file. Issues an E_USER_NOTICE and returns an empty array, if the list of tables is empty.
Name | Type | Description |
---|---|---|
$prefix | int | currently one of YANA_TRIGGER_BEFORE, YANA_TRIGGER_AFTER |
$operation | string | one of insert, update, delete |
$table | string | |
$columns | array | (optional) |
Retrieves all "trigger" entries that apply to the given operation on the dataset and returns the results as an numeric array.
There are two constants to use for argument $prefix: The first, YANA_TRIGGER_BEFORE, refers to triggers that fire BEFORE the action $operation is carried out. And YANA_TRIGGER_AFTER, refers to triggers that fire AFTER the action $operation has been carried out.
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns the 'type' attribute of $column in $table as a lower-cased string. Returns string("") if there is no $table, or the table has no column named $column, or the column does not have a 'type' attribute.
Name | Type | Description |
---|---|---|
$table | string |
Returns a numeric array of all columns in $table, that are marked with the option UNQIUE => true (which means, all columns that have an unique constraint).
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns bool(true) if a table named $table is listed in the current structure file and it has a column named $column, which has an index. Returns bool(false) otherwise. Note that this operation is not case sensitive.
Always call this first before anything else.
Redefinition of: SML::init()
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns bool(true) if a table named $table is listed in the current structure file and it has a column named $column in its list of contents. Returns bool(false) otherwise. Note that this operation is not case sensitive.
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns bool(true) if a table named $table is listed in the current structure file and it has a column named $column in its list of foreign keys. Returns bool(false) otherwise. Note that this operation is not case sensitive.
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns bool(true) if a table named $table is listed in the current structure file and its primary key is named $column. Returns bool(false) otherwise. Note that this operation is not case sensitive.
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns bool(true) if:
Returns bool(false) otherwise.
Name | Type | Description |
---|---|---|
$table | string |
Returns bool(true) if a table with the given name is listed in the current structure file and bool(false) otherwise. Note that this operation is not case sensitive.
Name | Type | Description |
---|---|---|
$table | string | |
$column | string |
Returns bool(true) if a table named $table is listed in the current structure file, it has a column named $column in its list of contents and this column has a unique constraint. Returns bool(false) otherwise. Note that this operation is not case sensitive.
Name | Type | Description |
---|---|---|
$table | string | |
$column | string | |
$value | mixed | |
$escape | int |
Inherited From SML
Inherited From SecureFileStream
Inherited From SecureInputStream
Inherited From InputStream
Inherited From Object
Documentation generated on Wed, 22 Nov 2006 20:19:18 +0100 by phpDocumentor 1.3.1