mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Replace deprecated extraStatics with new methods on Versioned and Hierarchy
This commit is contained in:
parent
876f4c5299
commit
9c2ebc3e5f
@ -25,19 +25,9 @@ class Hierarchy extends DataExtension {
|
||||
function augmentWrite(&$manipulation) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $class
|
||||
* @param string $extension
|
||||
* @return array
|
||||
*/
|
||||
function extraStatics($class=null, $extension=null) {
|
||||
return array(
|
||||
'has_one' => array(
|
||||
// TODO this method is called *both* statically and on an instance
|
||||
"Parent" => ($class) ? $class : $this->owner->class
|
||||
)
|
||||
);
|
||||
static function add_to_class($class, $extensionClass) {
|
||||
Config::inst()->update($class, 'has_one', array('Parent' => $class));
|
||||
parent::add_to_class($class, $extensionClass);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,24 +103,14 @@ class Versioned extends DataExtension {
|
||||
$this->liveStage = array_pop($stages);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $class
|
||||
* @param string $extension
|
||||
* @return array
|
||||
*/
|
||||
function extraStatics($class=null, $extension=null) {
|
||||
return array(
|
||||
'db' => array(
|
||||
'Version' => 'Int',
|
||||
),
|
||||
'has_many' => array(
|
||||
// TODO this method is called *both* statically and on an instance
|
||||
'Versions' => ($class) ? $class : $this->owner->class,
|
||||
)
|
||||
static $db = array(
|
||||
'Version' => 'Int'
|
||||
);
|
||||
}
|
||||
|
||||
static function add_to_class($class, $extensionClass) {
|
||||
Config::inst()->update($class, 'has_many', array('Versions' => $class));
|
||||
parent::add_to_class($class, $extensionClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Amend freshly created DataQuery objects with versioned-specific information
|
||||
|
Loading…
Reference in New Issue
Block a user