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

View File

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