jobRepository->create(compact('configuration')); return $this->process($this->jobRepository->save($job)); } catch (PDOException $exception) { throw new Create(__CLASS__, $exception); } } /** * @return array * @throws Read */ public function getPending(): array { try { return array_map([$this, 'process'],$this->jobRepository->fetchPending()); } catch (EmptyResult $exception) { throw new Read(__CLASS__, $exception); } } protected function process(Model\Job $job): Model\Job { return $job; } }