2016-10-14 03:30:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\Core\Tests\ObjectTest;
|
|
|
|
|
2017-05-17 07:40:13 +02:00
|
|
|
class T2 extends BaseObject
|
2016-10-14 03:30:05 +02:00
|
|
|
{
|
2016-12-16 05:34:21 +01:00
|
|
|
protected $failover;
|
2020-04-20 19:58:09 +02:00
|
|
|
protected $failoverArr = [];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->failover = new T1A();
|
|
|
|
$this->failoverArr[0] = new T1B();
|
|
|
|
$this->failoverArr[1] = new T1C();
|
|
|
|
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function defineMethods()
|
|
|
|
{
|
|
|
|
$this->addWrapperMethod('Wrapping', 'wrappedMethod');
|
|
|
|
|
|
|
|
$this->addMethodsFrom('failover');
|
|
|
|
$this->addMethodsFrom('failoverArr', 0);
|
|
|
|
$this->addMethodsFrom('failoverArr', 1);
|
2017-08-22 01:22:08 +02:00
|
|
|
$this->addCallbackMethod('failoverCallback', function ($inst, $args) {
|
|
|
|
return true;
|
|
|
|
});
|
2016-12-16 05:34:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function wrappedMethod($val)
|
|
|
|
{
|
|
|
|
return $val;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function normalMethod()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|