mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
62 lines
1.3 KiB
PHP
62 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace SilverStripe\ORM\Tests\DataExtensionTest;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
class MyObject extends DataObject implements TestOnly
|
|
{
|
|
private static $table_name = 'DataExtensionTest_MyObject';
|
|
|
|
private static $db = [
|
|
'Title' => 'Varchar',
|
|
];
|
|
|
|
private static $extensions = [
|
|
Extension1::class,
|
|
Extension2::class,
|
|
Faves::class,
|
|
AllMethodNames::class
|
|
];
|
|
|
|
public function canOne($member = null)
|
|
{
|
|
// extended access checks
|
|
$results = $this->extend('canOne', $member);
|
|
if ($results && is_array($results)) {
|
|
if (!min($results)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public function canTwo($member = null)
|
|
{
|
|
// extended access checks
|
|
$results = $this->extend('canTwo', $member);
|
|
if ($results && is_array($results)) {
|
|
if (!min($results)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public function canThree($member = null)
|
|
{
|
|
// extended access checks
|
|
$results = $this->extend('canThree', $member);
|
|
if ($results && is_array($results)) {
|
|
if (!min($results)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|