| @@ 17-42 (lines=26) @@ | ||
| 14 | use Longman\Platfourm\Service\EntityService; |
|
| 15 | use Longman\Platfourm\Text\Repositories\Eloquent\TextRepository; |
|
| 16 | ||
| 17 | class UpdateTextValueService extends EntityService |
|
| 18 | { |
|
| 19 | ||
| 20 | protected $repository; |
|
| 21 | protected $authUserService; |
|
| 22 | ||
| 23 | public function __construct( |
|
| 24 | AuthUserService $authUserService, |
|
| 25 | TextRepository $repository |
|
| 26 | ) { |
|
| 27 | $this->authUserService = $authUserService; |
|
| 28 | $this->repository = $repository; |
|
| 29 | ||
| 30 | $authUserService->should('text.update'); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function run(array $options, $value) |
|
| 34 | { |
|
| 35 | $this->checkRepository(); |
|
| 36 | ||
| 37 | $entity = $this->repository->updateValue($options, $value); |
|
| 38 | ||
| 39 | return $this->parseResult($entity); |
|
| 40 | } |
|
| 41 | ||
| 42 | } |
|
| 43 | ||
| @@ 17-42 (lines=26) @@ | ||
| 14 | use Longman\Platfourm\Service\EntityService; |
|
| 15 | use Longman\Platfourm\Text\Repositories\Eloquent\TextRepository; |
|
| 16 | ||
| 17 | class UpdateTextValueService extends EntityService |
|
| 18 | { |
|
| 19 | ||
| 20 | protected $repository; |
|
| 21 | protected $authUserService; |
|
| 22 | ||
| 23 | public function __construct( |
|
| 24 | AuthUserService $authUserService, |
|
| 25 | TextRepository $repository |
|
| 26 | ) { |
|
| 27 | $this->authUserService = $authUserService; |
|
| 28 | $this->repository = $repository; |
|
| 29 | ||
| 30 | $authUserService->should('text.update'); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function run(array $options, $value) |
|
| 34 | { |
|
| 35 | $this->checkRepository(); |
|
| 36 | ||
| 37 | $entity = $this->repository->updateValue($options, $value); |
|
| 38 | ||
| 39 | return $this->parseResult($entity); |
|
| 40 | } |
|
| 41 | ||
| 42 | } |
|
| 43 | ||