mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
31 lines
811 B
PHP
31 lines
811 B
PHP
<?php
|
|
|
|
namespace SilverStripe\ORM\Tests\DataExtensionTest;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\Core\Extension;
|
|
|
|
class PlayerExtension extends Extension implements TestOnly
|
|
{
|
|
|
|
public static function get_extra_config($class = null, $extensionClass = null, $args = null)
|
|
{
|
|
$config = [];
|
|
|
|
// Only add these extensions if the $class is set to DataExtensionTest_Player, to
|
|
// test that the argument works.
|
|
if (strcasecmp($class ?? '', Player::class) === 0) {
|
|
$config['db'] = [
|
|
'Address' => 'Text',
|
|
'DateBirth' => 'Date',
|
|
'Status' => "Enum('Shooter,Goalie')"
|
|
];
|
|
$config['defaults'] = [
|
|
'Status' => 'Goalie'
|
|
];
|
|
}
|
|
|
|
return $config;
|
|
}
|
|
}
|