2014-02-18 03:39:13 +01:00
|
|
|
<?php
|
|
|
|
|
2017-09-06 05:49:23 +02:00
|
|
|
namespace SilverStripe\ContentReview\Models;
|
|
|
|
|
|
|
|
use SilverStripe\CMS\Model\SiteTree;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
2017-09-06 23:29:27 +02:00
|
|
|
use SilverStripe\Security\Member;
|
2017-09-06 05:49:23 +02:00
|
|
|
use SilverStripe\Security\Security;
|
|
|
|
|
2023-12-14 03:10:51 +01:00
|
|
|
/**
|
|
|
|
* @method Member Reviewer()
|
|
|
|
* @method SiteTree SiteTree()
|
|
|
|
*/
|
2015-11-02 00:27:42 +01:00
|
|
|
class ContentReviewLog extends DataObject
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2017-09-11 02:56:05 +02:00
|
|
|
private static $db = [
|
2015-11-02 00:27:42 +01:00
|
|
|
"Note" => "Text",
|
2017-09-11 02:56:05 +02:00
|
|
|
];
|
2015-11-02 00:27:42 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2017-09-11 02:56:05 +02:00
|
|
|
private static $has_one = [
|
2017-09-06 05:49:23 +02:00
|
|
|
"Reviewer" => Member::class,
|
|
|
|
"SiteTree" => SiteTree::class,
|
2017-09-11 02:56:05 +02:00
|
|
|
];
|
2015-11-02 00:27:42 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2017-09-11 02:56:05 +02:00
|
|
|
private static $summary_fields = [
|
|
|
|
"Note" => ["title" => "Note"],
|
|
|
|
"Created" => ["title" => "Reviewed at"],
|
|
|
|
"Reviewer.Title" => ["title" => "Reviewed by"]
|
|
|
|
];
|
2015-11-02 00:27:42 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private static $default_sort = "Created DESC";
|
|
|
|
|
2017-09-06 05:49:23 +02:00
|
|
|
private static $table_name = 'ContentReviewLog';
|
|
|
|
|
2015-11-02 00:27:42 +01:00
|
|
|
/**
|
|
|
|
* @param mixed $member
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function canView($member = null)
|
|
|
|
{
|
2017-09-06 05:49:23 +02:00
|
|
|
return (bool) Security::getCurrentUser();
|
2015-11-02 00:27:42 +01:00
|
|
|
}
|
2014-02-18 03:39:13 +01:00
|
|
|
}
|