2017-11-29 03:20:09 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\RestfulServer\Tests\Stubs;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
2018-02-08 04:56:21 +01:00
|
|
|
use SilverStripe\ORM\DataObject;
|
2017-11-29 03:20:09 +01:00
|
|
|
|
|
|
|
class RestfulServerTestAuthor extends DataObject implements TestOnly
|
|
|
|
{
|
|
|
|
private static $api_access = true;
|
|
|
|
|
|
|
|
private static $table_name = 'RestfulServerTestAuthor';
|
|
|
|
|
|
|
|
private static $db = array(
|
2019-05-20 01:04:52 +02:00
|
|
|
'FirstName' => 'Text',
|
2017-11-29 03:20:09 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
private static $many_many = array(
|
|
|
|
'RelatedPages' => RestfulServerTestPage::class,
|
|
|
|
'RelatedAuthors' => RestfulServerTestAuthor::class,
|
2018-04-06 01:10:32 +02:00
|
|
|
'SortedPages' => [
|
|
|
|
'through' => AuthorSortedPageRelation::class,
|
|
|
|
'from' => 'Parent',
|
|
|
|
'to' => 'SortedPage',
|
|
|
|
],
|
2017-11-29 03:20:09 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
private static $has_many = array(
|
|
|
|
'PublishedPages' => RestfulServerTestPage::class,
|
|
|
|
'Ratings' => RestfulServerTestAuthorRating::class,
|
2018-04-06 01:10:32 +02:00
|
|
|
'SortedPagesRelation' => AuthorSortedPageRelation::class . '.Parent',
|
2017-11-29 03:20:09 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
public function canView($member = null)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|