Version: current

# Class SortableDataObject

Plug-ins for additional functionality in your DataObjects.

Note: DataObjectDecorators are not actually Decorators in the GoF Design Patterns sense of the word. A better name for this class would be DataExtension. However, in the interests of backward compatibility we haven't renamed the class.

  Extension
  DataObjectDecorator
  SortableDataObject

Package: sapphire\model
Located at dataobject_manager/code/SortableDataObject.php

## Methods summary

`public static` | # `set_sort_dir( mixed $dir )`
`public static` | # `add_sortable_class( mixed $className )`
`public array` | # `extraStatics( )` Define extra database fields Define extra database fields Return a map where the keys are db, has_one, etc, and the values are additional fields/relations to be defined. #### Returns `array` Returns a map where the keys are db, has_one, etc, and the values are additional fields/relations to be defined. #### Overrides `DataObjectDecorator::extraStatics`
`public static` | # `add_sortable_classes( array $classes )`
`public static` | # `add_sortable_many_many_relation( mixed $ownerClass, mixed $componentName )`
`public static` | # `remove_sortable_class( mixed $class )`
`public static` | # `is_sortable_class( mixed $classname )`
`public static` | # `is_sortable_many_many( mixed $componentClass, mixed $parentClass = null )`
`public static` | # `get_join_tables( mixed $classname )`
`public` | # `augmentSQL( `SQLQuery` & $query )` Edit the given query object to support queries for this extension Edit the given query object to support queries for this extension #### Parameters $query SQLQuery $query Query to augment. #### Overrides `DataObjectDecorator::augmentSQL`
`public` | # `onBeforeWrite( )` #### Overrides `DataObjectDecorator::onBeforeWrite`

### Methods inherited from DataObjectDecorator

`augmentDatabase()`, `augmentWrite()`, `can()`, `canCreate()`, `canDelete()`, `canEdit()`, `flushCache()`, `load_extra_statics()`, `onAfterDelete()`, `onAfterWrite()`, `onBeforeDelete()`, `populateDefaults()`, `requireDefaultRecords()`, `updateCMSActions()`, `updateCMSFields()`, `updateFieldLabels()`, `updateFrontEndFields()`, `updateSummaryFields()`

### Methods inherited from Extension

`__construct()`, `clearOwner()`, `getOwner()`, `get_classname_without_arguments()`, `setOwner()`

### Magic methods summary

## Properties summary

`public static array` | $sortable_classes | #
`public static array` | $many_many_sortable_relations | #
`public static string` | $sort_dir | #

### Properties inherited from DataObjectDecorator

`$decoratable_statics`

### Properties inherited from Extension

`$allowed_actions`, `$class`, `$owner`, `$ownerBaseClass`

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -