mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
78 lines
1.5 KiB
PHP
78 lines
1.5 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
|
|
{
|
|
}
|