2023-06-07 04:59:02 +02:00
|
|
|
<?php
|
|
|
|
|
2023-07-06 04:21:28 +02:00
|
|
|
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 = [
|
2024-05-08 01:12:51 +02:00
|
|
|
'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,
|
2023-07-06 07:15:13 +02:00
|
|
|
'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,
|
|
|
|
];
|
|
|
|
}
|