fORMOrderingstatic classv1.0.0b15
Allows a column in an fActiveRecord class to be a relative sort order column
| 1.0.0b15 | Fixed a bug with ordering columns that are part of a multi-column unique constraint 11/13/09 |
|---|---|
| 1.0.0b14 | Fixed a bug affecting where conditions with columns that are not null but have a default value 11/3/09 |
| 1.0.0b13 | Updated code for the new fORMDatabase and fORMSchema APIs 10/28/09 |
| 1.0.0b12 | Changed SQL statements to use value placeholders, identifier escaping and schema support 10/22/09 |
| 1.0.0b11 | Fixed another bug with deleting records in the middle of a set, added support for reordering multiple records at once 7/17/09 |
| 1.0.0b10 | Fixed a bug with deleting multiple in-memory records in the same set 7/15/09 |
| 1.0.0b9 | Fixed a bug with using fORM::registerInspectCallback() 7/15/09 |
| 1.0.0b8 | Updated to use new fORM::registerInspectCallback() method 7/13/09 |
| 1.0.0b7 | Fixed validate() so it properly ignores ordering columns in multi-column unique constraints 6/17/09 |
| 1.0.0b6 | Updated code for new fORM API 6/15/09 |
| 1.0.0b5 | Updated class to automatically correct ordering values that are too high 6/14/09 |
| 1.0.0b4 | Updated code to use new fValidationException::formatField() method 6/4/09 |
| 1.0.0b3 | Fixed a bug with setting a new record to anywhere but the end of a set 3/18/09 |
| 1.0.0b2 | Fixed a bug with inspect(), 'max_ordering_value' was being returned as 'max_ordering_index' 3/2/09 |
| 1.0.0b | The initial implementation 6/25/08 |
Static Methods
::configureOrderingColumn() public
Sets a column to be an ordering column
There can only be one ordering column per class/table and it must be part of a single or multi-column UNIQUE constraint.
Signature
void configureOrderingColumn( mixed $class, string $column )
Parameters
| mixed | $class | The class name or instance of the class |
| string | $column | The column to set as an ordering column |
::delete() internal public
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
Re-orders other records in the set when the record specified is deleted
Signatures
void delete( fActiveRecord $object )
void delete( array $values, array $old_values, array $related_records, array $cache )
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 |
::inspect() internal public
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
Returns the metadata about a column including features added by this class
Signatures
mixed inspect( fActiveRecord $object, string $method_name, array $parameters )
mixed inspect( array $values, array $old_values, array $related_records, array $cache )
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 |
Returns
The metadata array or element specified
::reflect() internal public
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
Signatures
void reflect( string $class, boolean $include_doc_comments )
void reflect( array $signatures )
Parameters
| 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 |
::reorder() internal public
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
Re-orders the object based on it's current state and new position
Signatures
void reorder( fActiveRecord $object )
void reorder( array $values, array $old_values, array $related_records, array $cache )
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 |
::reset() internal public
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
Signature
void reset( )
::validate() internal public
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
Makes sure the ordering value is sane, removes error messages about missing values
Signatures
void validate( fActiveRecord $object )
void validate( array $values, array $old_values, array $related_records, array $cache, array $validation_messages )
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 |
| array | &$validation_messages | An array of ordered validation messages |
