eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::toStorageFieldDefinition PHP Method

toStorageFieldDefinition() public method

Maps $fieldDef to the legacy storage specific StorageFieldDefinition.
public toStorageFieldDefinition ( eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDef, StorageFieldDefinition $storageFieldDef )
$fieldDef eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
$storageFieldDef eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition
    public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageFieldDefinition $storageFieldDef)
    {
        $converter = $this->converterRegistry->getConverter($fieldDef->fieldType);
        $converter->toStorageFieldDefinition($fieldDef, $storageFieldDef);
    }

Usage Example

 /**
  * 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
     );
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::toStorageFieldDefinition