Updates a $fieldDefinition for $typeId.
abstract public updateFieldDefinition ( mixed $typeId, integer $status, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition, |
||
$typeId | mixed | |
$status | integer | |
$fieldDefinition | eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition | |
$storageFieldDef |
/** * Updates a $fieldDefinition for $typeId. * * @param mixed $typeId * @param int $status * @param \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition * @param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition $storageFieldDef */ public function updateFieldDefinition($typeId, $status, FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef) { try { return $this->innerGateway->updateFieldDefinition($typeId, $status, $fieldDefinition, $storageFieldDef); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * This method updates the given $fieldDefinition on a Type. * * This method creates a new status of the Type with the updated * $fieldDefinition. It does not update existing content objects depending * on the * field (default) values. * * @param mixed $contentTypeId * @param \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition * * @return void */ public function updateFieldDefinition( $contentTypeId, $status, FieldDefinition $fieldDefinition ) { $storageFieldDef = new StorageFieldDefinition(); $this->mapper->toStorageFieldDefinition( $fieldDefinition, $storageFieldDef ); $this->contentTypeGateway->updateFieldDefinition( $contentTypeId, $status, $fieldDefinition, $storageFieldDef ); }