/** * Returns field definition for the given field definition id * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If field definition is not found * * @param mixed $id * @param int $status One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED * * @return \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition */ public function getFieldDefinition($id, $status) { $row = $this->contentTypeGateway->loadFieldDefinition($id, $status); if ($row === false) { throw new NotFoundException("FieldDefinition", array("id" => $id, "status" => $status)); } return $this->mapper->extractFieldFromRow($row); }
/** * Loads an array with data about field definition referred $id and $status. * * @param mixed $id field definition id * @param int $status field definition status * * @return array Data rows. */ public function loadFieldDefinition($id, $status) { try { return $this->innerGateway->loadFieldDefinition($id, $status); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }