| Total Complexity | 2 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | trait RestResourcePatch |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * Before lifecycle method for patch method. |
||
| 26 | */ |
||
| 27 | 12 | public function beforePatch(string &$id, RestDtoInterface $restDto, EntityInterface $entity): void |
|
| 28 | { |
||
| 29 | 12 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * After lifecycle method for patch method. |
||
| 33 | * |
||
| 34 | * Notes: If you make changes to entity in this lifecycle method by default it will be saved on end of current |
||
| 35 | * request. To prevent this you need to detach current entity from entity manager. |
||
| 36 | * |
||
| 37 | * Also note that if you've made some changes to entity and you eg. throw an exception within this method |
||
| 38 | * your entity will be saved if it has eg Blameable / Timestampable traits attached. |
||
| 39 | */ |
||
| 40 | 12 | public function afterPatch(string &$id, RestDtoInterface $dto, EntityInterface $entity): void |
|
| 42 | 12 | } |
|
| 43 | } |
||
| 44 |