2016-10-14 03:30:05 +02:00
|
|
|
<?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
|
|
|
|
{
|
2016-12-16 05:34:21 +01:00
|
|
|
public function isVersionedTable($table)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
/**
|
|
|
|
* 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()';
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|