1 | <?php |
||
8 | class Relationship { |
||
9 | |||
10 | /** @var Table */ |
||
11 | protected $model; |
||
12 | |||
13 | /** @var Table */ |
||
14 | protected $foreign; |
||
15 | |||
16 | /** @var ForeignKey */ |
||
17 | protected $fk; |
||
18 | |||
19 | public function __construct(Table $model, Table $foreign, ForeignKey $fk) { |
||
24 | |||
25 | /** |
||
26 | * Returns the type of this relationship |
||
27 | * |
||
28 | * @return string |
||
29 | */ |
||
30 | public function getType() { |
||
33 | |||
34 | /** |
||
35 | * |
||
36 | * @return Table |
||
37 | */ |
||
38 | public function getModel() { |
||
41 | |||
42 | /** |
||
43 | * |
||
44 | * @return Table |
||
45 | */ |
||
46 | public function getForeign() { |
||
49 | |||
50 | /** |
||
51 | * |
||
52 | * @return ForeignKey |
||
53 | */ |
||
54 | public function getForeignKey() { |
||
57 | |||
58 | /** |
||
59 | * Returns the related name in studly case |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | public function getRelatedName() { |
||
71 | |||
72 | /** |
||
73 | * Returns the related name for using in api environment (slug, type-name, etc) |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getRelatedTypeName() { |
||
80 | } |