eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler::storeFieldData PHP Method

storeFieldData() public method

Stores data from $field in its corresponding external storage.
public storeFieldData ( eZ\Publish\SPI\Persistence\Content\VersionInfo $versionInfo, eZ\Publish\SPI\Persistence\Content\Field $field )
$versionInfo eZ\Publish\SPI\Persistence\Content\VersionInfo
$field eZ\Publish\SPI\Persistence\Content\Field
    public function storeFieldData(VersionInfo $versionInfo, Field $field)
    {
        return $this->storageRegistry->getStorage($field->type)->storeFieldData($versionInfo, $field, $this->context);
    }

Usage Example

コード例 #1
0
 /**
  * Updates an existing field in the database.
  *
  * Used by self::createNewFields() and self::updateFields()
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Field $field
  * @param \eZ\Publish\SPI\Persistence\Content $content
  *
  * @return void
  */
 protected function updateField(Field $field, Content $content)
 {
     $this->contentGateway->updateField($field, $this->mapper->convertToStorageValue($field));
     // If the storage handler returns true, it means that $field value has been modified
     // So we need to update it in order to store those modifications
     // Field converter is called once again via the Mapper
     if ($this->storageHandler->storeFieldData($content->versionInfo, $field) === true) {
         $this->contentGateway->updateField($field, $this->mapper->convertToStorageValue($field));
     }
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler::storeFieldData