/** * Loads data for an object state. * * @param mixed $stateId * * @return array */ public function loadObjectStateData($stateId) { try { return $this->innerGateway->loadObjectStateData($stateId); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Loads an object state * * @param mixed $stateId * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException if the state was not found * * @return \eZ\Publish\SPI\Persistence\Content\ObjectState */ public function load($stateId) { $data = $this->objectStateGateway->loadObjectStateData($stateId); if (empty($data)) { throw new NotFoundException("ObjectState", $stateId); } return $this->objectStateMapper->createObjectStateFromData($data); }