bristol-su /
control
| 1 | <?php |
||
| 2 | |||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 3 | namespace BristolSU\ControlDB\AdditionalProperties; |
||
| 4 | |||
| 5 | /** |
||
| 6 | * Handles storing the additional properties models can define |
||
| 7 | */ |
||
|
0 ignored issues
–
show
|
|||
| 8 | interface AdditionalPropertyStore |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Add a property to a model. |
||
| 13 | * |
||
| 14 | * Properties must be initialised before they can be used. |
||
| 15 | * |
||
| 16 | * @param string $model Model class name to add the property to |
||
| 17 | * @param string $key Key of the property |
||
|
0 ignored issues
–
show
|
|||
| 18 | * @return void |
||
|
0 ignored issues
–
show
|
|||
| 19 | */ |
||
| 20 | public function addProperty(string $model, string $key): void; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Does the given model have any properties |
||
| 24 | * |
||
| 25 | * @param string $model Full class name of the model |
||
| 26 | * @return bool If the model has properties |
||
|
0 ignored issues
–
show
|
|||
| 27 | */ |
||
| 28 | public function hasProperties(string $model): bool; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Get all properties a model has |
||
| 32 | * |
||
| 33 | * @param string $model Full class name of the model |
||
| 34 | * @return array Array of property keys. |
||
|
0 ignored issues
–
show
|
|||
| 35 | */ |
||
| 36 | public function getProperties(string $model): array; |
||
| 37 | |||
| 38 | } |