silverstripe-framework/tests/php/Model/ModelDataTest/UnescapedCaster.php

23 lines
424 B
PHP
Raw Normal View History

2016-10-14 03:30:05 +02:00
<?php
namespace SilverStripe\Model\Tests\ModelDataTest;
2016-10-14 03:30:05 +02:00
use SilverStripe\Core\Convert;
use SilverStripe\Dev\TestOnly;
use SilverStripe\Model\ModelData;
2016-10-14 03:30:05 +02:00
class UnescapedCaster extends ModelData implements TestOnly
2016-10-14 03:30:05 +02:00
{
protected $value;
2016-10-14 03:30:05 +02:00
public function setValue($value)
{
$this->value = $value;
}
2016-10-14 03:30:05 +02:00
public function forTemplate(): string
{
return Convert::raw2xml($this->value);
}
2016-10-14 03:30:05 +02:00
}