silverstripe-framework/tests/php/ORM/VersionableExtensionsTest/TestExtension.php

29 lines
789 B
PHP
Raw Normal View History

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
{
public function isVersionedTable($table)
{
return true;
}
2016-10-14 03:30:05 +02: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
}