2016-04-12 12:55:34 +02:00
|
|
|
<?php
|
|
|
|
|
2017-10-20 00:16:53 +02:00
|
|
|
namespace Wilr\GoogleSitemaps\Tests\Model;
|
2016-04-12 12:55:34 +02:00
|
|
|
|
2016-11-02 12:39:25 +01:00
|
|
|
use SilverStripe\ORM\DataObject;
|
2017-10-20 00:16:53 +02:00
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\Control\Director;
|
|
|
|
|
|
|
|
class TestDataObject extends DataObject implements TestOnly
|
2016-04-12 12:55:34 +02:00
|
|
|
{
|
2023-10-27 22:23:54 +02:00
|
|
|
protected $private = false;
|
2017-10-20 00:16:53 +02:00
|
|
|
|
|
|
|
private static $db = array(
|
2016-04-12 12:55:34 +02:00
|
|
|
'Priority' => 'Varchar(10)'
|
2017-10-20 00:16:53 +02:00
|
|
|
);
|
2016-04-12 12:55:34 +02:00
|
|
|
|
|
|
|
public function canView($member = null)
|
|
|
|
{
|
2023-10-27 22:23:54 +02:00
|
|
|
if ($this->private) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-04-12 12:55:34 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2023-10-27 22:23:54 +02:00
|
|
|
|
|
|
|
public function setPrivate()
|
|
|
|
{
|
|
|
|
$this->private = true;
|
|
|
|
}
|
|
|
|
|
2016-04-12 12:55:34 +02:00
|
|
|
public function AbsoluteLink()
|
|
|
|
{
|
|
|
|
return Director::absoluteBaseURL();
|
|
|
|
}
|
|
|
|
}
|