Total Complexity | 3 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | trait MapFields |
||
17 | { |
||
18 | protected ?Collection $mapFields; |
||
19 | |||
20 | /** |
||
21 | * Initializes the map fields. |
||
22 | * |
||
23 | * This method is responsible for initializing the necessary map fields for the model |
||
24 | * |
||
25 | * @return void |
||
26 | */ |
||
27 | public function initializeMapFields(): void |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Sets the fields for mapping data. |
||
34 | * |
||
35 | * @param Collection|null $mapFields The array of map fields. |
||
36 | * Pass null to disable the mappings. |
||
37 | */ |
||
38 | public function setMapFields(?Collection $mapFields): void |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Returns the map fields. |
||
45 | * |
||
46 | * This method retrieves the map fields for the model. |
||
47 | * If map fields have been set, it returns the collection of map fields. |
||
48 | * If no map fields have been set, it returns null. |
||
49 | * |
||
50 | * Note: The map fields are the fields that are mapped during the data assignation (save). |
||
51 | * |
||
52 | * @return Collection|null The collection of map fields or null if no map fields have been set. |
||
53 | */ |
||
54 | public function getMapFields(): ?Collection |
||
59 |