Remove old PHP $this casting

This commit is contained in:
Robbie Averill 2016-12-19 13:56:53 +13:00
parent de1b947c97
commit cc17e81952
2 changed files with 11 additions and 13 deletions

View File

@ -142,20 +142,18 @@ class Blog extends Page implements PermissionProvider
Requirements::css(BLOGGER_DIR . '/css/cms.css');
Requirements::javascript(BLOGGER_DIR . '/js/cms.js');
$self =& $this;
$this->beforeUpdateCMSFields(function ($fields) use ($self) {
if (!$self->canEdit()) {
$this->beforeUpdateCMSFields(function ($fields) {
if (!$this->canEdit()) {
return;
}
$categories = GridField::create(
'Categories',
_t('Blog.Categories', 'Categories'),
$self->Categories(),
$this->Categories(),
GridFieldCategorisationConfig::create(
15,
$self->Categories()->sort('Title'),
$this->Categories()->sort('Title'),
BlogCategory::class,
'Categories',
'BlogPosts'
@ -165,10 +163,10 @@ class Blog extends Page implements PermissionProvider
$tags = GridField::create(
'Tags',
_t('Blog.Tags', 'Tags'),
$self->Tags(),
$this->Tags(),
GridFieldCategorisationConfig::create(
15,
$self->Tags()->sort('Title'),
$this->Tags()->sort('Title'),
BlogTag::class,
'Tags',
'BlogPosts'

View File

@ -58,14 +58,14 @@ class BlogPost extends Page
private static $db = array(
'PublishDate' => 'Datetime',
'AuthorNames' => 'Varchar(1024)',
'Summary' => 'HTMLText',
'Summary' => 'HTMLText'
);
/**
* @var array
*/
private static $has_one = array(
'FeaturedImage' => 'SilverStripe\\Assets\\Image',
'FeaturedImage' => 'SilverStripe\\Assets\\Image'
);
/**
@ -74,7 +74,7 @@ class BlogPost extends Page
private static $many_many = array(
'Categories' => 'SilverStripe\\Blog\\Model\\BlogCategory',
'Tags' => 'SilverStripe\\Blog\\Model\\BlogTag',
'Authors' => 'SilverStripe\\Security\\Member',
'Authors' => 'SilverStripe\\Security\\Member'
);
/**
@ -83,7 +83,7 @@ class BlogPost extends Page
private static $defaults = array(
'ShowInMenus' => false,
'InheritSideBar' => true,
'ProvideComments' => true,
'ProvideComments' => true
);
/**
@ -112,7 +112,7 @@ class BlogPost extends Page
*/
private static $casting = array(
'Excerpt' => 'HTMLText',
'Date' => 'SS_Datetime'
'Date' => 'DBDatetime'
);
/**