1 | <?php |
||
13 | class DirectForeignKeyMethodDescriptor implements MethodDescriptorInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var ForeignKeyConstraint |
||
17 | */ |
||
18 | private $fk; |
||
19 | |||
20 | private $useAlternateName = false; |
||
21 | /** |
||
22 | * @var Table |
||
23 | */ |
||
24 | private $mainTable; |
||
25 | /** |
||
26 | * @var NamingStrategyInterface |
||
27 | */ |
||
28 | private $namingStrategy; |
||
29 | |||
30 | /** |
||
31 | * @param ForeignKeyConstraint $fk The foreign key pointing to our bean |
||
32 | * @param Table $mainTable The main table that is pointed to |
||
33 | * @param NamingStrategyInterface $namingStrategy |
||
34 | */ |
||
35 | public function __construct(ForeignKeyConstraint $fk, Table $mainTable, NamingStrategyInterface $namingStrategy) |
||
41 | |||
42 | /** |
||
43 | * Returns the name of the method to be generated. |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getName() : string |
||
61 | |||
62 | /** |
||
63 | * Returns the name of the class that will be returned by the getter (short name). |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | public function getBeanClassName(): string |
||
71 | |||
72 | /** |
||
73 | * Requests the use of an alternative name for this method. |
||
74 | */ |
||
75 | public function useAlternativeName() |
||
79 | |||
80 | /** |
||
81 | * Returns the code of the method. |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getCode() : string |
||
115 | |||
116 | private function getFilters(ForeignKeyConstraint $fk) : string |
||
132 | |||
133 | /** |
||
134 | * Returns an array of classes that needs a "use" for this method. |
||
135 | * |
||
136 | * @return string[] |
||
137 | */ |
||
138 | public function getUsedClasses() : array |
||
142 | |||
143 | /** |
||
144 | * Returns the code to past in jsonSerialize. |
||
145 | * |
||
146 | * @return string |
||
147 | */ |
||
148 | public function getJsonSerializeCode() : string |
||
152 | } |
||
153 |