| Total Complexity | 0 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class RelatedPageLink extends DataObject |
||
| 10 | { |
||
| 11 | private static $table_name = 'BasePage_RelatedPages'; |
||
|
|
|||
| 12 | |||
| 13 | private static $extensions = [ |
||
| 14 | Versioned::class, |
||
| 15 | ]; |
||
| 16 | |||
| 17 | private static $db = [ |
||
| 18 | 'SortOrder' => 'Int', |
||
| 19 | ]; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * For backwards compatibility these must match a traditional 'many_many' definition. |
||
| 23 | * This was BasePage.RelatedPages => BasePage |
||
| 24 | * ManyMany relations are normally joined by ${DefiningClass}ID && ${RelatedClass}ID |
||
| 25 | * excepting in the case where ${DefiningClass} === ${RelatedClass} |
||
| 26 | * Then the 'related class' column changes from ${RelatedClass}ID to "ChildID". |
||
| 27 | * |
||
| 28 | * {@see SilverStripe\ORM\DataObjectSchema->parseManyManyComponent()} |
||
| 29 | * |
||
| 30 | * @var array |
||
| 31 | * @config |
||
| 32 | */ |
||
| 33 | private static $has_one = [ |
||
| 34 | 'BasePage' => BasePage::class, |
||
| 35 | 'Child' => BasePage::class, |
||
| 36 | ]; |
||
| 38 |