| @@ 19-34 (lines=16) @@ | ||
| 16 | * Class AbstractDeleteService |
|
| 17 | * @package DavisPeixoto\BlogCore\Service |
|
| 18 | */ |
|
| 19 | abstract class AbstractDeleteService extends AbstractWriteService implements ServiceInterface |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @return boolean |
|
| 23 | */ |
|
| 24 | public function run(): bool |
|
| 25 | { |
|
| 26 | try { |
|
| 27 | return $this->repository->delete($this->entity); |
|
| 28 | } catch (Exception $e) { |
|
| 29 | $this->logger->error($e->getMessage()); |
|
| 30 | } |
|
| 31 | ||
| 32 | return false; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 19-34 (lines=16) @@ | ||
| 16 | * Class AbstractSaveService |
|
| 17 | * @package DavisPeixoto\BlogCore\Service |
|
| 18 | */ |
|
| 19 | abstract class AbstractSaveService extends AbstractWriteService implements ServiceInterface |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @return string|null |
|
| 23 | */ |
|
| 24 | public function run() |
|
| 25 | { |
|
| 26 | try { |
|
| 27 | return $this->repository->save($this->entity); |
|
| 28 | } catch (Exception $e) { |
|
| 29 | $this->logger->error($e->getMessage()); |
|
| 30 | } |
|
| 31 | ||
| 32 | return null; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||