silverstripe-framework/tests/php/ORM/DataListTest/EagerLoading/EagerLoadObject.php

52 lines
1.5 KiB
PHP
Raw Normal View History

2023-06-07 04:59:02 +02:00
<?php
namespace SilverStripe\ORM\Tests\DataListTest\EagerLoading;
2023-06-07 04:59:02 +02:00
use SilverStripe\ORM\DataObject;
use SilverStripe\Dev\TestOnly;
class EagerLoadObject extends DataObject implements TestOnly
{
private static $table_name = 'EagerLoadObject';
private static $db = [
'Title' => 'Varchar'
];
private static $has_one = [
'HasOneEagerLoadObject' => HasOneEagerLoadObject::class,
'HasOnePolymorphObject' => DataObject::class,
2023-06-07 04:59:02 +02:00
];
private static $belongs_to = [
'BelongsToEagerLoadObject' => BelongsToEagerLoadObject::class
];
private static $has_many = [
'HasManyEagerLoadObjects' => HasManyEagerLoadObject::class
];
private static $many_many = [
'ManyManyEagerLoadObjects' => ManyManyEagerLoadObject::class,
'ManyManyThroughEagerLoadObjects' => [
'through' => EagerLoadObjectManyManyThroughEagerLoadObject::class,
'from' => 'EagerLoadObject',
'to' => 'ManyManyThroughEagerLoadObject',
],
'MixedManyManyEagerLoadObjects' => MixedManyManyEagerLoadObject::class,
'ManyManyEagerLoadWithExtraFields' => ManyManyEagerLoadObject::class,
];
private static $many_many_extraFields = [
'ManyManyEagerLoadWithExtraFields' => [
'SomeText' => 'Varchar',
'SomeBool' => 'Boolean',
'SomeInt' => 'Int',
],
2023-06-07 04:59:02 +02:00
];
private static $belongs_many_many = [
'BelongsManyManyEagerLoadObjects' => BelongsManyManyEagerLoadObject::class,
];
}