. */ namespace SP\Domain\Config; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; use SP\DataModel\ConfigData; use SP\DataModel\Dto\ConfigRequest; use SP\Infrastructure\Common\Repositories\NoSuchItemException; /** * Class ConfigService * * @package SP\Domain\Config\Services */ interface ConfigServiceInterface { /** * @throws NoSuchItemException * @throws \SP\Domain\Common\Services\ServiceException */ public function getByParam(string $param, $default = null); /** * @throws ConstraintException * @throws QueryException */ public function create(ConfigData $configData): int; /** * @throws \SP\Domain\Common\Services\ServiceException */ public function saveBatch(ConfigRequest $configRequest): void; /** * @throws ConstraintException * @throws QueryException */ public function save(string $param, $value): bool; /** * Obtener un array con la configuración almacenada en la BBDD. * * @return ConfigData[] * @throws ConstraintException * @throws QueryException */ public function getAll(): array; /** * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException */ public function deleteByParam(string $param): void; }