mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
d18c931ecf
Includes the following large-scale changes: - Impoved barrier between model and view layers - Improved casting of scalar to relevant DBField types - Improved capabilities for rendering arbitrary data in templates
53 lines
1.1 KiB
PHP
53 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace SilverStripe\View\Tests\SSTemplateEngineTest;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
class TestObject extends DataObject implements TestOnly
|
|
{
|
|
private static $table_name = 'SSTemplateEngineTest_Object';
|
|
|
|
public $number = null;
|
|
|
|
private static $casting = [
|
|
'Link' => 'Text',
|
|
];
|
|
|
|
|
|
public function __construct($number = null)
|
|
{
|
|
parent::__construct();
|
|
$this->number = $number;
|
|
}
|
|
|
|
public function Number()
|
|
{
|
|
return $this->number;
|
|
}
|
|
|
|
public function absoluteBaseURL()
|
|
{
|
|
return "testLocalFunctionPriorityCalled";
|
|
}
|
|
|
|
public function lotsOfArguments11($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k)
|
|
{
|
|
return $a . $b . $c . $d . $e . $f . $g . $h . $i . $j . $k;
|
|
}
|
|
|
|
public function Link()
|
|
{
|
|
return 'some/url.html';
|
|
}
|
|
|
|
public function getMyProperty(mixed $someArg = null): string
|
|
{
|
|
if ($someArg) {
|
|
return "Was passed in: $someArg";
|
|
}
|
|
return 'Nothing passed in';
|
|
}
|
|
}
|