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