| Total Complexity | 5 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class PersistOperation implements Serializable |
||
| 19 | { |
||
| 20 | /** @var Serializable */ |
||
| 21 | private $object; |
||
| 22 | |||
| 23 | /** @var Operation */ |
||
| 24 | private $operation; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param Serializable $object The entity that needs to be persisted. |
||
| 28 | * @param Operation $operation The type of persistence (update, delete, or |
||
| 29 | * create). |
||
| 30 | */ |
||
| 31 | public function __construct(Serializable $object, Operation $operation) |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @api |
||
| 39 | * @return Operation The type of persistence. |
||
| 40 | */ |
||
| 41 | public function getType(): Operation |
||
| 42 | { |
||
| 43 | return $this->operation; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @api |
||
| 48 | * @return Serializable The entity to persist. |
||
| 49 | */ |
||
| 50 | public function getObject(): Serializable |
||
| 53 | } |
||
| 54 | |||
| 55 | public function serialize() |
||
| 60 | ]); |
||
| 61 | } |
||
| 62 | |||
| 63 | public function unserialize($serialized) |
||
| 70 |