silverstripe-framework/tests/php/ORM/DataObjectSchemaTest/AllIndexes.php
2019-02-27 16:40:12 +13:00

35 lines
821 B
PHP

<?php
namespace SilverStripe\ORM\Tests\DataObjectSchemaTest;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBIndexable;
/**
* @property int $Number
* @property string $Content
* @property string $Title
*/
class AllIndexes extends DataObject implements TestOnly
{
private static $table_name = 'DataObjectSchemaTest_AllIndexes';
private static $db = [
'Title' => 'Varchar',
'Content' => 'Varchar',
'Number' => 'Int',
];
private static $indexes = [
'Content' => true,
'IndexCols' => ['Title', 'Content'],
'IndexUnique' => [
'type' => DBIndexable::TYPE_UNIQUE,
'columns' => ['Number'],
],
'IndexNormal' => [
'columns' => ['Title'],
],
];
}