1 | <?php |
||
13 | class ActionNameGenerator { |
||
14 | |||
15 | /** |
||
16 | * Generates an action name for a given model and a type |
||
17 | * |
||
18 | * @param string $type |
||
19 | * @param Table $model |
||
20 | * @return string|null Returns the name or null if the type is unknown |
||
21 | */ |
||
22 | public static function generate($type, Table $model) { |
||
42 | |||
43 | /** |
||
44 | * Generates the name for a create action |
||
45 | * |
||
46 | * @param Table $model |
||
47 | * @return string |
||
48 | */ |
||
49 | public static function generateCreate(Table $model) { |
||
52 | |||
53 | /** |
||
54 | * Generates the name for a read action |
||
55 | * |
||
56 | * @param Table $model |
||
57 | * @return string |
||
58 | */ |
||
59 | public static function generateRead(Table $model) { |
||
62 | |||
63 | /** |
||
64 | * Generates the name for a list action |
||
65 | * |
||
66 | * @param Table $model |
||
67 | * @return string |
||
68 | */ |
||
69 | public static function generateList(Table $model) { |
||
72 | |||
73 | /** |
||
74 | * Generates the name for an update action |
||
75 | * |
||
76 | * @param Table $model |
||
77 | * @return string |
||
78 | */ |
||
79 | public static function generateUpdate(Table $model) { |
||
82 | |||
83 | /** |
||
84 | * Generates the name for a delete action |
||
85 | * |
||
86 | * @param Table $model |
||
87 | * @return string |
||
88 | */ |
||
89 | public static function generateDelete(Table $model) { |
||
92 | |||
93 | /** |
||
94 | * Generates the name for a relationship action with a given relationship and type |
||
95 | * |
||
96 | * @param string $type |
||
97 | * @param Relationship $relationship |
||
98 | * @return string|null Returns the name or null if the type is unknown |
||
99 | */ |
||
100 | public static function generateRelationship($type, Relationship $relationship) { |
||
117 | |||
118 | /** |
||
119 | * Generates the name for a relationship read action |
||
120 | * |
||
121 | * @param Relationship $relationship |
||
122 | * @return string |
||
123 | */ |
||
124 | public static function generateRelationshipRead(Relationship $relationship) { |
||
130 | |||
131 | /** |
||
132 | * Generates the name for a relationship update action |
||
133 | * |
||
134 | * @param Relationship $relationship |
||
135 | * @return string |
||
136 | */ |
||
137 | public static function generateRelationshipUpdate(Relationship $relationship) { |
||
143 | |||
144 | /** |
||
145 | * Generates the name for a relationship add action |
||
146 | * |
||
147 | * @param Relationship $relationship |
||
148 | * @return string |
||
149 | */ |
||
150 | public static function generateRelationshipAdd(Relationship $relationship) { |
||
156 | |||
157 | /** |
||
158 | * Generates the name for a relationship remove action |
||
159 | * |
||
160 | * @param Relationship $relationship |
||
161 | * @return string |
||
162 | */ |
||
163 | public static function generateRelationshipRemove(Relationship $relationship) { |
||
169 | } |