Creates a class for accassing a database table.
The access restriction for this class should be treated as 'friendly' - only accessable by classes in the same package.
Located in /code/framework/RSDEngine/RSDEngineDBTable.php (line 37)
The authors, each stored as one array element. Gets set inside the constructor method.
The prefix all columns of this table. Often f_. Providing a column prefix makes the generated code more readable because the prefix can be remove where appropriate. Set in the construtor method.
An array that holds all RSDEngineColumn objects for this table. New columns are added by calling the method _addColumn.
The SQL DDL for this table. Gets set inside the construtor method.
The copyright information. This string must not contain newlines. Gets set inside the constructor method.
Whether to ignore this table. Is set inside the method _parse.
The RSDEngineDBTable::_parse will not add the table to its internal stack of tables if $ignore evaluates true.
An array that holds the RSDEngineMethod objects for the class to generate. New methods are added by calling addMethod.
The name of the table.
The project name. Gets set inside the constructor method.
An array of all RSDRelation objects having this table as starting point. New relations are added by calling the method _addRelation.
Holds a handle to the RSDEngineDB instance that created this instance.
An array holding all table options. These are defined between the table name and the opening brace.
The prefix of this table. Often t_ or an shorthand for the project name of the form prj_. Providing a table prefix makes the generated code more readable because the prefix can be remove where appropriate. Set in the construtor method.
PHP Code to be executed after a delete operation.
PHP Code to be executed after an insert operation.
PHP Code to be executed after an update operation.
PHP Code to be executed before a delete operation.
PHP Code to be executed before an insert operation.
PHP Code to be executed before an update operation.
An array of patterns used to exclude selectIncluding* methods.
An array containing all file table options of this table.
This array get filled by RSDEngineDBTable::_parseTableOptions.
An array of patterns used to include excluded selectIncluding* methods.
The label to be used for records of this table.
This property gets set by RSDEngineDBTable::_parseLabelTableOption.
An array containing all LiveUser table options of this table.
This array gets filled by RSDEngineDBTable::_parseTableOptions.
An array that holds each set of relations that was used to build a selectIncluding method.
New elements are added by createSelectIncludingMethod. This property is required by the method _getSelectIncludingMethodName. Each element will be again an array. The name of the selectIncluding method will be used as key.
An array of all unique constraints of this table. Each constraint is represented by an array holding all column names that build that constraint. New unique constraints are added by calling the method _addUniqueConstraint.
Constructor that initializes this instance and calls parse.
Adds an instance of RSDEngineMethod to $this->methods.
Returns true if a column with such a name exists, otherwise false is returned.
Gets called by RSDEngine::_checkRelations
Creates all methods that depend an a column that is a primary or a foreign key.
Calls _createDeleteByMethods, _createUpdateByMethods, _createGetByMethods, _createInsertMethod, _createIsValidMethods, _createGetNextMethods, _createStoreUploadedMethods, _createRemoveStoredMethods, _createGetStoredMethods, _createCanUpdate, _createCanDelete, _createCanSelect
Creates a selectIncluding* method.
Gets called by RSDEngine::_createJoinFunctionsForTable. RSDEngineDBTable::prepareSelectIncludingMethod should be called before!
Returns the code for the child class.
Returns a reasonalbe name for an instance created from the child class.
Returns the name of generated child class.
The generated child class does nothing but inherit the generated base class. This is because it enables the RSDEngine to update the base class without overwriting what the developer had to code by himself. Man-generated code has to be implemented in the child class! The name is constructed like this:
1 function getChildClassName()
2 {
3 return ucfirst($this->projectName) . ucfirst($this->getTableNameWithoutPrefix());
4 }
Returns the name of generated class.
The name is constructed like this:
1 function getClassName()
2 {
3 return ucfirst($this->projectName) . ucfirst($this->getTableNameWithoutPrefix()) . "Base";
4 }
Returns the code for the base class.
Returns the column named $columnName or an instance of RSError on failure.
Returns the name of the method that can be used to delete records by the primary key from this table.
Returns the name of the method that can be used to retrive records by the primary key from this table.
Returns the name for identifyer that holds a newly created instance of the created class.
Returns the first column defined as primary key
Returns all columns that are returned from the method selectIncludingAll.
Returns the name of this table for use as a variable name.
Returns the name of this table without the prefix.
Returns the name of the method that can be used to update records by the primary key in this table.
Parses the table options saved in $this->tableOptions.
For now there are only LiveUser table options. Gets called by RSDEngineDBTable::_createKeyMethods.
Does some preparation for the method createSelectIncludingMethod.
This method should be called for all methods before createSelectIncludingMethod is called. This method will fill $this->_selectIncludingMethodRelations.
Returns a literal representation of this RSDEngineDBTable instance.
Adds an instance of RSDEngineColumn to the array $this->columns.
Adds an instance of RSDRelation to the array $this->relations.
Adds an array holding representing a unique constraint to the array $this->_uniqueConstraints.
Creates the method 'canDelete';
Creates the method 'canDelete';
Creates the method 'canUpdate';
Calls generateUpdateLiveUserRightMethods and generateCanUpdateLiveUserRightMethods on all RSDEngineColumn objects stored in $this->columns.
Creates the method 'checkUniqueConstrains'.
Creates a deleteByCOLUMNNAME method for each column that is a primary or a foreign key.
Creates the method 'delete';
Creates a getByCOLUMNNAME method for each column that is a primary or a foreign key.
Creates just one method: getIsValidMethodName.
Creates just one method: getLabelColumn.
Calls generateGetNextMethod on all RSDEngineColumn objects stored in $this->columns.
If generateGetNextMethod returns a valid RSDEngineMethod object addMethod is called with the RSDEngineMethod object as argument.
Creates just one method: getSmartyHTMLOptionsArray.
Calls generateGetStoredMethod on all RSDEngineColumn objects stored in $this->columns.
If generateGetStoredMethod returns a valid RSDEngineMethod object addMethod is called with the RSDEngineMethod object as argument.
Creates the method 'insert';
Calls generateIsValidMethod on all RSDEngineColumn objects stored in $this->columns.
Creates the method '_parseOptions'.
Calls generateRemoveStoredMethod on all RSDEngineColumn objects stored in $this->columns.
If generateRemoveStoredMethod returns a valid RSDEngineMethod object addMethod is called with the RSDEngineMethod object as argument.
Creates the method 'select';
Calls generateStoreUploadedMethod on all RSDEngineColumn objects stored in $this->columns.
If generateStoreUploadedMethod returns a valid RSDEngineMethod object addMethod is called with the RSDEngineMethod object as argument.
Creates a updateByCOLUMNNAME method for each column that is a primary or a foreign key.
Creates the method 'update';
Returns a string with all column names seperated by ", ".
Returns a string with all column names formatted for use as identifyers and prefixd with '$', seperated by ', ' and optionally quoted.
To put single quotes around the identifieyers pass the boolean value true as argument. The method getColumnNameForVariableName is called on every column.
Creates just one method: the constructor.
Returns the requested RSDEngineFileOption instance or the boolean value false if non-existing.
Returns the name of the selectIncluding method that performs a join at least over all tables saved in $tableNames.
This method tries to find the method performing the smalles join in which all elements of $tableNames are involved. This method can be called with a string argument:
1 $this->_getSelectIncludingMethodName('prj_mytable');
Or if you need multiple tables to be involved in the join:
1 $this->_getSelectIncludingMethodName(array('prj_mytable', 'prj_mytable2'));
Parses the SQL DDL stored in $this->contents.
The method _parseBodyLine($bodyLine) gets called for each line.
Parses the afterDelete table option saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the afterInsert table option saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the afterUpdate table option saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the beforeDelete table option saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the beforeInsert table option saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the beforeUpdate table option saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses on line of SQL-Code.
If a column definition is found a new instance of RSDEngineColumn is created an stored in the associativ array columns. If a foreign key is found a new instance of RSDRelation is created an stored in the array relations. This method is called by the method _parse().
Parses the excludeSelectMethod table options saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the file table options saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the includeSelectMethod table options saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the file table options saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Parses the LiveUserEdit table options saved in $this->tableOptions.
Gets called by RSDEngineDBTable::parseTableOptions.
Sets the property selectIncludingMethod for all LiveUserRight instances.
This method is called in RSDEngineDBTable::createKeyMethods. The property selectIncludingMethod cannot be set earlier because the selectIncluding* methods must be generated first.
Documentation generated on Mon, 8 Dec 2003 13:12:19 +0100 by phpDocumentor 1.2.3