Class RSDEngineColumn

Description

Holds all information for one column of an RSDEngineDBTable.

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 4146)


	
			
Variable Summary
Method Summary
RSDEngineColumn RSDEngineColumn (String $name, String $table, String $isValid, mixed $inputType, mixed $inputTypeData, String $sequenceName, boolean $doNotInsert, boolean $doNotUpdate, boolean $doNotSelect, mixed $editLiveUserRightOptions, mixed $editLiveUserGroupOptions, mixed $editLiveUserAreaOptions, String $defaultInsertValue, String $defaultUpdateValue, String $key, boolean $unique, String $columnPrefix, mixed $definition, mixed &$rsdEngineDBTable, boolean $editLiveUserRight, boolean $editLiveUserGroup, boolean $editLiveUserArea)
void getHTMLInputTag ()
boolen isAnyKey ()
void setForeignKeyTarget (mixed $foreignKeyTarget)
void setIsValidFileOptions (Array $options)
void setKey (String $key)
String toString ()
Variables
String $columnPrefix = "" (line 4265)

The prefix of this column name. Often f_. Providing a column prefix makes the generated code more readable because the prefix can be remove where appropriate.

String $defaultInsertValue = "" (line 4244)

If non-empty this value is used in the generated insert method. Is set in the construtor method.

  • see: RSDEngineDBTable::_createInsertMethod
  • see: RSDEngineColumn::RSDEngineColumn
String $defaultUpdateValue = "" (line 4252)

If non-empty this value is used in the generated update method. Is set in the construtor method.

  • see: RSDEngineDBTable::_createInsertMethod
  • see: RSDEngineColumn::RSDEngineColumn
String $definition = "" (line 4294)

The sql definition of this column. Gets set inside the constructor.

boolean $doNotInsert = false (line 4195)

Whether no input filed should be generated for this column in the create template. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
boolean $doNotSelect = false (line 4209)

Whether this columns should not be selected (displayed via a template). Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
boolean $doNotUpdate = false (line 4202)

Whether no input filed should be generated for this column in the update template. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
Array $editLiveUserAreaOptions = array() (line 4236)

If this property contains any elements the LiveUser area stored in this column by ID is made editable through a generated template and controller.

This property gets set to an array of strings (option definitions) inside the constructor method and updated inside parseLiveUserOptions() to an array of RSDEngineEditLiveUserAreaOption.

Array $editLiveUserGroupOptions = array() (line 4227)

If this property contains any elements the LiveUser group stored in this column by ID is made editable through a generated template and controller.

This property gets set to an array of strings (option definitions) inside the constructor method and updated inside parseLiveUserOptions() to an array of RSDEngineEditLiveUserGroupOption.

Array $editLiveUserRightOptions = array() (line 4218)

If this property contains any elements the LiveUser right stored in this column by ID is made editable through a generated template and controller.

This property gets set to an array of strings (option definitions) inside the constructor method and updated inside parseLiveUserOptions() to an array of RSDEngineEditLiveUserRightOption.

String $foreignKeyTarget = "" (line 4271)

Where this column that is defined as a foreign key references to. If this column is not a foreign key this property is ignored.

String $inputType = "" (line 4167)

The input type for this column. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
String $inputTypeData = "" (line 4174)

The the input type data (e.g. the options for a select box) for this column. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
boolean $isForeignKey = false (line 4283)

If this column is a foreign key.

boolean $isPrimaryKey = false (line 4277)

If this column is a primary key.

boolean $isUndefinedKey = false (line 4289)

If this column is an undefined key.

String $isValid = "" (line 4160)

The isValid defintion of this column. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
String $name = "" (line 4153)

The name of this column. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
RSDEngineDBTable $rsdEngineDBTable = null (line 4299)

The RSDEngineDBTable instance that created this instance.

String $sequenceName = "" (line 4188)

The name of the sequence from which to fetch the next id. Pass an empty string if no sequence should be used. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
String $table = "" (line 4181)

The name of the table that contains this column. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
boolean $unique = false (line 4259)

Indicates whether the values for this column must be unique. Is set in the construtor method.

  • see: RSDEngineColumn::RSDEngineColumn
Array $_isValidFileOptions = null (line 4307)

An associative array holding the validation options for this column.

Gets set by setIsValidFileOptions if this column is defined as isValid:file.

Methods
Constructor RSDEngineColumn (line 4327)

The constructor that initializes this instance.

RSDEngineColumn RSDEngineColumn (String $name, String $table, String $isValid, mixed $inputType, mixed $inputTypeData, String $sequenceName, boolean $doNotInsert, boolean $doNotUpdate, boolean $doNotSelect, mixed $editLiveUserRightOptions, mixed $editLiveUserGroupOptions, mixed $editLiveUserAreaOptions, String $defaultInsertValue, String $defaultUpdateValue, String $key, boolean $unique, String $columnPrefix, mixed $definition, mixed &$rsdEngineDBTable, boolean $editLiveUserRight, boolean $editLiveUserGroup, boolean $editLiveUserArea)
  • String $name: The name of this column.
  • String $table: The name of the table that contains this column.
  • String $isValid: A string that defines the validation performed for this column. See the tutorial for details!
  • String $sequenceName: The name of the sequence from which to fetch the next id. Pass an empty string if no sequence should be used.
  • boolean $doNotInsert: Whether no input filed should be generated for this column in the create template.
  • boolean $doNotUpdate: Whether no input filed should be generated for this column in the update template.
  • boolean $doNotSelect: Whether this column should not be displayed via a template.
  • boolean $editLiveUserRight: If this property is set to true, the LiveUser right stored in this column by ID is made editable through a generated template and controller.
  • boolean $editLiveUserGroup: If this property is set to true, the LiveUser group stored in this column by ID is made editable through a generated template and controller.
  • boolean $editLiveUserArea: If this property is set to true, the LiveUser area stored in this column by ID is made editable through a generated template and controller.
  • String $defaultInsertValue: If non-empty this value is used in the generated insert method.
  • String $defaultUpdateValue: If non-empty this value is used in the generated update method.
  • String $key: If the string "primary", "foreign" or "undefined" is passed this column is treated as a key. This means that getBy, updateBy and deleteBy method are created for it.
  • boolean $unique: Indicates whether the values for this column must be unique.
  • String $columnPrefix: The prefix of this column name. Often f_. Providing a column prefix makes the generated code more readable because the prefix can be remove where appropriate.
generateActivateGroupMethod (line 5147)
void generateActivateGroupMethod ()
generateActivateGroupMethodName (line 5062)
void generateActivateGroupMethodName ()
generateAddAdminToAreaMethod (line 4834)
void generateAddAdminToAreaMethod ()
generateAddAdminToAreaMethodName (line 4821)
void generateAddAdminToAreaMethodName ()
generateAddUserToGroupMethod (line 5073)
void generateAddUserToGroupMethod ()
generateAddUserToGroupMethodName (line 5050)
void generateAddUserToGroupMethodName ()
generateCanActivateGroupMethodName (line 5040)
void generateCanActivateGroupMethodName ()
generateCanAddAdminToAreaMethodName (line 4808)
void generateCanAddAdminToAreaMethodName ()
generateCanAddUserToGroupMethodName (line 5028)
void generateCanAddUserToGroupMethodName ()
generateCanDeactivateGroupMethodName (line 5044)
void generateCanDeactivateGroupMethodName ()
generateCanGrantRightToGroupMethodName (line 4598)
void generateCanGrantRightToGroupMethodName ()
generateCanGrantRightToUserMethodName (line 4588)
void generateCanGrantRightToUserMethodName ()
generateCanRemoveAdminFromAreaMethodName (line 4812)
void generateCanRemoveAdminFromAreaMethodName ()
generateCanRemoveUserFromGroupMethodName (line 5032)
void generateCanRemoveUserFromGroupMethodName ()
generateCanRevokeRightFromGroupMethodName (line 4603)
void generateCanRevokeRightFromGroupMethodName ()
generateCanRevokeRightFromUserMethodName (line 4593)
void generateCanRevokeRightFromUserMethodName ()
generateCanUpdateAreaNameAndCommentMethodName (line 4816)
void generateCanUpdateAreaNameAndCommentMethodName ()
generateCanUpdateGroupNameAndCommentMethodName (line 5036)
void generateCanUpdateGroupNameAndCommentMethodName ()
generateCanUpdateLiveUserAreaMethods (line 4908)
void generateCanUpdateLiveUserAreaMethods ()
generateCanUpdateLiveUserGroupMethods (line 5196)
void generateCanUpdateLiveUserGroupMethods ()
generateCanUpdateLiveUserRightMethods (line 4708)
void generateCanUpdateLiveUserRightMethods ()
generateDeactivateGroupMethod (line 5171)
void generateDeactivateGroupMethod ()
generateDeactivateGroupMethodName (line 5066)
void generateDeactivateGroupMethodName ()
generateGetNextMethod (line 5628)

Generates and Returns the getNext* method for this column.

  • return: If the property sequenceName is not an empty string a new instance of RSDEngineMethod is returned; otherwise false is returned.
  • see: RSDEngineColumn::$sequenceName
mixed generateGetNextMethod ()
generateGetNextMethodName (line 5618)

Returns the name of the getNext* method for this column.

  • return: The name of the getNext* method.
String generateGetNextMethodName ()
generateGetStoredMethod (line 4532)
void generateGetStoredMethod ()
generateGetStoredMethodName (line 5609)

Returns the name of the getStored* method for this column.

  • return: The name of the getStored* method.
String generateGetStoredMethodName ()
generateGrantRightToGroupMethodName (line 4619)
void generateGrantRightToGroupMethodName ()
generateGrantRightToUserMethodName (line 4609)
void generateGrantRightToUserMethodName ()
generateIsValidMethod (line 5358)

Generates and Returns the isValid* method for this column.

  • return: The isValid method.
RSDEngineMethod generateIsValidMethod ()
generateIsValidMethodName (line 5582)

Returns the name of the isValid* method for this column.

  • return: The name of the isValid* method.
String generateIsValidMethodName ()
generateRemoveAdminFromAreaMethod (line 4858)
void generateRemoveAdminFromAreaMethod ()
generateRemoveAdminFromAreaMethodName (line 4825)
void generateRemoveAdminFromAreaMethodName ()
generateRemoveStoredMethod (line 4517)
void generateRemoveStoredMethod ()
generateRemoveStoredMethodName (line 5600)

Returns the name of the removeStored* method for this column.

  • return: The name of the removeStored* method.
String generateRemoveStoredMethodName ()
generateRemoveUserFromGroupMethod (line 5097)
void generateRemoveUserFromGroupMethod ()
generateRemoveUserFromGroupMethodName (line 5054)
void generateRemoveUserFromGroupMethodName ()
generateRevokeRightFromGroupMethodName (line 4624)
void generateRevokeRightFromGroupMethodName ()
generateRevokeRightFromUserMethodName (line 4614)
void generateRevokeRightFromUserMethodName ()
generateStoreUploadedMethod (line 4477)
void generateStoreUploadedMethod ()
generateStoreUploadedMethodName (line 5591)

Returns the name of the storeUploaded* method for this column.

  • return: The name of the storeUploaded* method.
String generateStoreUploadedMethodName ()
generateUpdateAreaNameAndCommentMethod (line 4882)
void generateUpdateAreaNameAndCommentMethod ()
generateUpdateAreaNameAndCommentMethodName (line 4829)
void generateUpdateAreaNameAndCommentMethodName ()
generateUpdateGroupNameAndCommentMethod (line 5121)
void generateUpdateGroupNameAndCommentMethod ()
generateUpdateGroupNameAndCommentMethodName (line 5058)
void generateUpdateGroupNameAndCommentMethodName ()
generateUpdateLiveUserRightMethods (line 4633)

Generates the methods for granting a right to/revoking it from a user/group.

These four methods should only be created if this column was defined with any editLiveUserRight option.

  • return: An array of RSDEngineMethod objects.
Array generateUpdateLiveUserRightMethods ()
getColumnNameForPartialMethodName (line 5669)

Returns the column name suitable for including it in a method name.

This is done like this:


1 function getColumnNameForPartialMethodName()
2 {
3 $str = ucfirst(strtolower($this->getColumnNameWithoutPrefix()));
4 //the e modifier makes the second argument to be parsed as PHP-Code!
5 return preg_replace("/_([a-z0-9])/ie","strtoupper('\\1')",$str);
6 }

String getColumnNameForPartialMethodName ()
getColumnNameForVariableName (line 5684)

Returns the column name suitable for use as an identifyer name.

This is done like this:


1 function getColumnNameForVariableName()
2 {
3 $str = strtolower($this->getColumnNameWithoutPrefix());
4 //the e modifier makes the second argument to be parsed as PHP-Code!
5 return preg_replace("/_([a-z0-9])/ie","strtoupper('\\1')", $str);
6 }

String getColumnNameForVariableName ()
getColumnNameWithoutPrefix (line 5649)

Returns the column name without the prifix.

String getColumnNameWithoutPrefix ()
getForeignKeyTarget (line 4471)

Returns the value of the property foreignKeyTarget.

String getForeignKeyTarget ()
getHTMLInputTag (line 4380)
void getHTMLInputTag ()
getIsValidFileOptions (line 5340)

Returns the validation options for this column if it was defined as isValid:file.

  • return: An associtave array of options or null. The options are 'maxSize', 'contentType', 'storageDir' and 'storageDirConstant'.
mixed getIsValidFileOptions ()
getSequenceNameForVariableName (line 5695)

Returns the sequence name suitable for use as an identifyer name.

  • return: The sequence name suitable for use as an identifyer name.
String getSequenceNameForVariableName ()
isAnyKey (line 4447)

Returns true if this column is a primary, foreign or undefined key.

  • return: If this column is any key.
boolen isAnyKey ()
parseLiveUserOptions (line 4550)

This method will parse all editLiveUserRight, editLiveUserGroup and editLiveUserGroupOptions.

void parseLiveUserOptions ()
setForeignKeyTarget (line 4458)

Sets the property foreignKeyTarget makes this column a foreign key.

If the argument passed is not equal to (!==) the boolean value false setKey is called with the parameter 'foreign'.

void setForeignKeyTarget (mixed $foreignKeyTarget)
setIsValidFileOptions (line 5349)

Sets the validation options for this column that was defined as isValid:file.

void setIsValidFileOptions (Array $options)
  • Array $options: An associtave array of options. Valid options are 'maxSize', 'contentType', 'storageDir' and 'storageDirConstant'.
setKey (line 4421)

Sets the properties isPrimaryKey, isForeignKey and isUndefinedKey based on the string passed as argument.

Boolean values are assignd to these three properies:


1 function setKey($key)
2 {
3 $this->isPrimaryKey = ($key == "primary");
4 $this->isForeignKey = ($key == "foreign");
5 $this->isUndefinedKey = ($key == "undefined");
6 if ($this->isPrimaryKey) {
7 $this->unique = true;
8 $this->doNotUpdate = true;
9 if ($this->sequenceName == '') { //&& $makeSequenceAssumption
10 $this->sequenceName = 'seq_' .
11 strtolower($this->rsdEngineDBTable->rsdEngineDB->config['projectName']) .
12 '_' .
13 $this->rsdEngineDBTable->getTableNameWithoutPrefix() .
14 "_" .
15 $this->getColumnNameWithoutPrefix();
16 }
17 if($this->sequenceName != '') {
18 $this->defaultInsertValue = '$this->' . $this->generateGetNextMethodName() . "()";
19 }
20 }
21 }

void setKey (String $key)
  • String $key: Valid values are 'primary' for a primary key, 'foreign' for a foreign key, 'undefined' for an undefined key and an empty string for no key.
toString (line 5713)

Returns a literal representation of this column.

Format:


1 function toString()
2 {
3 return $this->fullName;
4 }

  • return: A literal representation of this column
String toString ()

Documentation generated on Mon, 8 Dec 2003 13:12:17 +0100 by phpDocumentor 1.2.3