
Provides special column functionality for fActiveRecord classes
1.0.0b15 | Fixed a bug with empty string email values passing through required validation 7/29/11 |
---|---|
1.0.0b14 | Updated code to work with the new fORM API 8/6/10 |
1.0.0b13 | Fixed reflect() to include some missing parameters 6/8/10 |
1.0.0b12 | Changed validation messages array to use column name keys 5/26/10 |
1.0.0b11 | Fixed a bug with prepareLinkColumn() returning http:// for empty link columns and not adding http:// to links that contained a /, but did not start with it 3/16/10 |
1.0.0b10 | Fixed reflect() to specify the value returned from set and generate methods, changed generate() methods to return the newly generated string 3/15/10 |
1.0.0b9 | Changed email columns to be automatically trimmed if they are a value email address surrounded by whitespace 3/14/10 |
1.0.0b8 | Made the validation on link columns a bit more strict 3/9/10 |
1.0.0b7 | Updated code for the new fORMDatabase and fORMSchema APIs 10/28/09 |
1.0.0b6 | Changed SQL statements to use value placeholders, identifier escaping and schema support 10/22/09 |
1.0.0b5 | Updated to use new fORM::registerInspectCallback() method 7/13/09 |
1.0.0b4 | Updated code for new fORM API 6/15/09 |
1.0.0b3 | Updated code to use new fValidationException::formatField() method 6/4/09 |
1.0.0b2 | Fixed a bug with objectifying number columns 11/24/08 |
1.0.0b | The initial implementation 5/27/08 |
Sets a column to be formatted as an email address
void configureEmailColumn( mixed $class, string $column )
mixed | $class | The class name or instance of the class to set the column format |
string | $column | The column to format as an email address |
Sets a column to be formatted as a link
void configureLinkColumn( mixed $class, string $column )
mixed | $class | The class name or instance of the class to set the column format |
string | $column | The column to format as a link |
Sets a column to be returned as an fNumber object from calls to get{ColumnName}()
void configureNumberColumn( mixed $class, string $column )
mixed | $class | The class name or instance of the class to set the column format |
string | $column | The column to return as an fNumber object |
Sets a column to be a random string column - a random string will be generated when the record is saved
void configureRandomColumn( mixed $class, string $column, string $type, integer $length )
mixed | $class | The class name or instance of the class |
string | $column | The column to set as a random column |
string | $type | The type of random string, must be one of: 'alphanumeric', 'alpha', 'numeric', 'hexadecimal' |
integer | $length | The length of the random string |
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Encodes a number column by calling fNumber::__toString()
string encodeNumberColumn( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache, string $method_name, array $parameters )
fActiveRecord | $object | The fActiveRecord instance |
array | &$values | The current values |
array | &$old_values | The old values |
array | &$related_records | Any records related to this record |
array | &$cache | The cache array for the record |
string | $method_name | The method that was called |
array | $parameters | The parameters passed to the method |
The encoded number
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Generates a new random value for the column
string generate( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache, string $method_name, array $parameters )
fActiveRecord | $object | The fActiveRecord instance |
array | &$values | The current values |
array | &$old_values | The old values |
array | &$related_records | Any records related to this record |
array | &$cache | The cache array for the record |
string | $method_name | The method that was called |
array | $parameters | The parameters passed to the method |
The newly generated random value
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Adds metadata about features added by this class
void inspect( string $class, string $column, array &$metadata )
string | $class | The class being inspected |
string | $column | The column being inspected |
array | &$metadata | The array of metadata about a column |
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Turns a numeric value into an fNumber object
mixed objectifyNumber( string $class, string $column, mixed $value )
string | $class | The class this value is for |
string | $column | The column the value is in |
mixed | $value | The value |
The fNumber object or raw value
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Prepares a link column so that the link will work properly in an a tag
string prepareLinkColumn( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache, string $method_name, array $parameters )
fActiveRecord | $object | The fActiveRecord instance |
array | &$values | The current values |
array | &$old_values | The old values |
array | &$related_records | Any records related to this record |
array | &$cache | The cache array for the record |
string | $method_name | The method that was called |
array | $parameters | The parameters passed to the method |
The formatted link
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Prepares a number column by calling fNumber::format()
string prepareNumberColumn( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache, string $method_name, array $parameters )
fActiveRecord | $object | The fActiveRecord instance |
array | &$values | The current values |
array | &$old_values | The old values |
array | &$related_records | Any records related to this record |
array | &$cache | The cache array for the record |
string | $method_name | The method that was called |
array | $parameters | The parameters passed to the method |
The formatted link
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Adjusts the fActiveRecord::reflect() signatures of columns that have been configured in this class
void reflect( string $class, array &$signatures, boolean $include_doc_comments )
string | $class | The class to reflect |
array | &$signatures | The associative array of {method name} => {signature} |
boolean | $include_doc_comments | If doc comments should be included with the signature |
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Resets the configuration of the class
void reset( )
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Sets the value for an email column, trimming the value if it is a valid email
fActiveRecord setEmailColumn( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache, string $method_name, array $parameters )
fActiveRecord | $object | The fActiveRecord instance |
array | &$values | The current values |
array | &$old_values | The old values |
array | &$related_records | Any records related to this record |
array | &$cache | The cache array for the record |
string | $method_name | The method that was called |
array | $parameters | The parameters passed to the method |
The record object, to allow for method chaining
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Sets the appropriate column values to a random string if the object is new
string setRandomStrings( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache )
fActiveRecord | $object | The fActiveRecord instance |
array | &$values | The current values |
array | &$old_values | The old values |
array | &$related_records | Any records related to this record |
array | &$cache | The cache array for the record |
The formatted link
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Validates all email columns
void validateEmailColumns( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache, array &$validation_messages )
fActiveRecord | $object | The fActiveRecord instance |
array | &$values | The current values |
array | &$old_values | The old values |
array | &$related_records | Any records related to this record |
array | &$cache | The cache array for the record |
array | &$validation_messages | An array of ordered validation messages |
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Validates all link columns
void validateLinkColumns( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache, array &$validation_messages )
fActiveRecord | $object | The fActiveRecord instance |
array | &$values | The current values |
array | &$old_values | The old values |
array | &$related_records | Any records related to this record |
array | &$cache | The cache array for the record |
array | &$validation_messages | An array of ordered validation messages |