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
@ -24,20 +24,10 @@ class Hierarchy extends DataExtension {
|
|||||||
|
|
||||||
function augmentWrite(&$manipulation) {
|
function augmentWrite(&$manipulation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
static function add_to_class($class, $extensionClass) {
|
||||||
*
|
Config::inst()->update($class, 'has_one', array('Parent' => $class));
|
||||||
* @param string $class
|
parent::add_to_class($class, $extensionClass);
|
||||||
* @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
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,26 +102,16 @@ class Versioned extends DataExtension {
|
|||||||
$this->defaultStage = reset($stages);
|
$this->defaultStage = reset($stages);
|
||||||
$this->liveStage = array_pop($stages);
|
$this->liveStage = array_pop($stages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
static $db = array(
|
||||||
*
|
'Version' => 'Int'
|
||||||
* @param string $class
|
);
|
||||||
* @param string $extension
|
|
||||||
* @return array
|
static function add_to_class($class, $extensionClass) {
|
||||||
*/
|
Config::inst()->update($class, 'has_many', array('Versions' => $class));
|
||||||
function extraStatics($class=null, $extension=null) {
|
parent::add_to_class($class, $extensionClass);
|
||||||
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,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Amend freshly created DataQuery objects with versioned-specific information
|
* Amend freshly created DataQuery objects with versioned-specific information
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user