mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-30 06:26:11 +02:00
32 lines
572 B
PHP
32 lines
572 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Dev\Tests\ViewableDataContainsTest;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\View\ViewableData;
|
|
|
|
class TestObject extends ViewableData implements TestOnly
|
|
{
|
|
protected $data = null;
|
|
|
|
public function __construct($data)
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
public function hasField($name)
|
|
{
|
|
return isset($this->data[$name]);
|
|
}
|
|
|
|
public function getField($name)
|
|
{
|
|
return isset($this->data[$name]) ?: null;
|
|
}
|
|
|
|
public function getSomething()
|
|
{
|
|
return 'something';
|
|
}
|
|
}
|