silverstripe-blog/code/compat/pages/BlogHolder.php
Cam Findlay 8a5c52a204 FIX Explicitly set the PostsPerPage during migration
Tested against the silverstripe.org codebase, BlogHolder migration fails unless you set this.
2015-10-29 13:10:10 +13:00

74 lines
1.2 KiB
PHP

<?php
/**
* @deprecated since version 2.0
*/
class BlogHolder extends BlogTree implements MigratableObject {
/**
* @var string
*/
private static $hide_ancestor = 'BlogHolder';
/**
* @var array
*/
private static $db = array(
'AllowCustomAuthors' => 'Boolean',
'ShowFullEntry' => 'Boolean',
);
/**
* @var array
*/
private static $has_one = array(
'Owner' => 'Member',
);
/**
* {@inheritdoc}
*/
public function canCreate($member = null) {
return false;
}
//Overload these to stop the Uncaught Exception: Object->__call(): the method 'parent' does not exist on 'BlogHolder' error.
public function validURLSegment() {
return true;
}
public function syncLinkTracking() {
return null;
}
/**
* {@inheritdoc}
*/
public function up() {
$published = $this->IsPublished();
if($this->ClassName === 'BlogHolder') {
$this->ClassName = 'Blog';
$this->RecordClassName = 'Blog';
$this->PostsPerPage = 10;
$this->write();
}
if($published){
$this->publish('Stage','Live');
$message = "PUBLISHED: ";
} else {
$message = "DRAFT: ";
}
return $message . $this->Title;
}
}
/**
* @deprecated since version 2.0
*/
class BlogHolder_Controller extends BlogTree_Controller {
}