mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
29 lines
728 B
PHP
29 lines
728 B
PHP
<?php
|
|
|
|
namespace SilverStripe\ORM\Tests\VersionableExtensionsTest;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\ORM\DataExtension;
|
|
use SilverStripe\ORM\Versioning\VersionableExtension;
|
|
|
|
class TestExtension extends DataExtension implements VersionableExtension, TestOnly
|
|
{
|
|
public function isVersionedTable($table)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Update fields and indexes for the versonable suffix table
|
|
*
|
|
* @param string $suffix Table suffix being built
|
|
* @param array $fields List of fields in this model
|
|
* @param array $indexes List of indexes in this model
|
|
*/
|
|
public function updateVersionableFields($suffix, &$fields, &$indexes)
|
|
{
|
|
$indexes['ExtraField'] = true;
|
|
$fields['ExtraField'] = 'Varchar()';
|
|
}
|
|
}
|