mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
API Rename SiteTree::description() to SiteTree::classDescription() to prevent clash
Fixes #1733
This commit is contained in:
parent
b8d9578679
commit
98e77a48a9
@ -636,7 +636,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
}
|
}
|
||||||
|
|
||||||
$singularName = $instance->i18n_singular_name();
|
$singularName = $instance->i18n_singular_name();
|
||||||
$description = $instance->i18n_description();
|
$description = $instance->i18n_classDescription();
|
||||||
|
|
||||||
$result->push(new ArrayData(array(
|
$result->push(new ArrayData(array(
|
||||||
'ClassName' => $class,
|
'ClassName' => $class,
|
||||||
|
@ -321,8 +321,8 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
* Description of the class functionality, typically shown to a user
|
* Description of the class functionality, typically shown to a user
|
||||||
* when selecting which page type to create. Translated through {@link provideI18nEntities()}.
|
* when selecting which page type to create. Translated through {@link provideI18nEntities()}.
|
||||||
*
|
*
|
||||||
* @see SiteTree::description()
|
* @see SiteTree::classDescription()
|
||||||
* @see SiteTree::i18n_description()
|
* @see SiteTree::i18n_classDescription()
|
||||||
*
|
*
|
||||||
* @config
|
* @config
|
||||||
* @var string
|
* @var string
|
||||||
@ -333,8 +333,8 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
* Description for Page and SiteTree classes, but not inherited by subclasses.
|
* Description for Page and SiteTree classes, but not inherited by subclasses.
|
||||||
* override SiteTree::$description in subclasses instead.
|
* override SiteTree::$description in subclasses instead.
|
||||||
*
|
*
|
||||||
* @see SiteTree::description()
|
* @see SiteTree::classDescription()
|
||||||
* @see SiteTree::i18n_description()
|
* @see SiteTree::i18n_classDescription()
|
||||||
*
|
*
|
||||||
* @config
|
* @config
|
||||||
* @var string
|
* @var string
|
||||||
@ -3085,11 +3085,11 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get description for this page
|
* Get description for this page type
|
||||||
*
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function description()
|
public function classDescription()
|
||||||
{
|
{
|
||||||
$base = in_array(static::class, [Page::class, self::class]);
|
$base = in_array(static::class, [Page::class, self::class]);
|
||||||
if ($base) {
|
if ($base) {
|
||||||
@ -3103,9 +3103,9 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
*
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function i18n_description()
|
public function i18n_classDescription()
|
||||||
{
|
{
|
||||||
$description = $this->description();
|
$description = $this->classDescription();
|
||||||
if ($description) {
|
if ($description) {
|
||||||
return _t(static::class.'.DESCRIPTION', $description);
|
return _t(static::class.'.DESCRIPTION', $description);
|
||||||
}
|
}
|
||||||
@ -3123,7 +3123,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
$entities = parent::provideI18nEntities();
|
$entities = parent::provideI18nEntities();
|
||||||
|
|
||||||
// Add optional description
|
// Add optional description
|
||||||
$description = $this->description();
|
$description = $this->classDescription();
|
||||||
if ($description) {
|
if ($description) {
|
||||||
$entities[static::class . '.DESCRIPTION'] = $description;
|
$entities[static::class . '.DESCRIPTION'] = $description;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user