
Allows a column in an fActiveRecord class to be a relative sort order column
1.0.0b19 | Updated code to work with the new fORM API 8/6/10 |
---|---|
1.0.0b18 | Changed configureOrderingColumn() to ensure the column specified can store negative values 7/21/10 |
1.0.0b17 | Changed validation messages array to use column name keys 5/26/10 |
1.0.0b16 | Updated the class to allow for multiple ordering columns per class 5/10/10 |
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 |
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.
void configureOrderingColumn( mixed $class, string $column )
mixed | $class | The class name or instance of the class |
string | $column | The column to set as an ordering 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
Re-orders other records in the set when the record specified is deleted
void delete( 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 |
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
mixed inspect( 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 metadata array or element specified
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
Re-orders the object based on it's current state and new position
void reorder( 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 |
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
Makes sure the ordering value is sane, removes error messages about missing values
void validate( 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 |