2016-10-14 03:30:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\ORM\Tests\VersionedTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
use SilverStripe\ORM\Versioning\Versioned;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Public access is provided via extension rather than overriding canViewVersioned
|
|
|
|
*
|
|
|
|
* @mixin Versioned
|
|
|
|
* @mixin PublicExtension
|
|
|
|
*/
|
|
|
|
class PublicViaExtension extends DataObject implements TestOnly
|
|
|
|
{
|
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $table_name = 'VersionedTest_PublicViaExtension';
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public function canView($member = null)
|
|
|
|
{
|
|
|
|
$extended = $this->extendedCan(__FUNCTION__, $member);
|
|
|
|
if ($extended !== null) {
|
|
|
|
return $extended;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $db = array(
|
|
|
|
'Title' => 'Varchar'
|
|
|
|
);
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $extensions = array(
|
|
|
|
Versioned::class,
|
|
|
|
PublicExtension::class,
|
|
|
|
);
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|