1 | <?php |
||
2 | |||
3 | namespace CWP\CWP\Model; |
||
4 | |||
5 | use CWP\CWP\PageTypes\BasePage; |
||
6 | use SilverStripe\ORM\DataObject; |
||
7 | use SilverStripe\Versioned\Versioned; |
||
8 | |||
9 | class RelatedPageLink extends DataObject |
||
10 | { |
||
11 | private static $table_name = 'BasePage_RelatedPages'; |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
12 | |||
13 | private static $extensions = [ |
||
0 ignored issues
–
show
|
|||
14 | Versioned::class, |
||
15 | ]; |
||
16 | |||
17 | private static $db = [ |
||
0 ignored issues
–
show
|
|||
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 = [ |
||
0 ignored issues
–
show
|
|||
34 | 'BasePage' => BasePage::class, |
||
35 | 'Child' => BasePage::class, |
||
36 | ]; |
||
37 | } |
||
38 |