2022-10-31 07:00:59 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\Dev\Tests\DeprecationTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
2022-11-15 06:20:54 +01:00
|
|
|
use SilverStripe\Dev\Deprecation;
|
2022-10-31 07:00:59 +01:00
|
|
|
|
|
|
|
class DeprecationTestObject extends DataObject implements TestOnly
|
|
|
|
{
|
2022-11-15 06:20:54 +01:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
Deprecation::withNoReplacement(function () {
|
|
|
|
Deprecation::notice(
|
|
|
|
'1.2.3',
|
|
|
|
'Some class message',
|
|
|
|
Deprecation::SCOPE_CLASS
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-10-31 07:00:59 +01:00
|
|
|
private static $db = [
|
|
|
|
"Name" => "Varchar"
|
|
|
|
];
|
|
|
|
|
|
|
|
private static $table_name = 'DeprecatedTestObject';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated 1.2.3 My first config message
|
|
|
|
*/
|
|
|
|
private static $first_config = 'ABC';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated My second config message
|
|
|
|
*/
|
|
|
|
private static $second_config = 'DEF';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
|
|
|
private static $third_config = 'XYZ';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated 1.2.3 My array config message
|
|
|
|
*/
|
|
|
|
private static $array_config = ['lorem', 'ipsum'];
|
|
|
|
}
|