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