mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
38 lines
757 B
PHP
38 lines
757 B
PHP
<?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
|
|
{
|
|
|
|
private static $table_name = 'VersionedTest_PublicViaExtension';
|
|
|
|
public function canView($member = null)
|
|
{
|
|
$extended = $this->extendedCan(__FUNCTION__, $member);
|
|
if ($extended !== null) {
|
|
return $extended;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
private static $db = array(
|
|
'Title' => 'Varchar'
|
|
);
|
|
|
|
private static $extensions = array(
|
|
Versioned::class,
|
|
PublicExtension::class,
|
|
);
|
|
}
|