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

getFieldData() public method

Fetches external data for $field from its corresponding external storage.
public getFieldData ( 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 getFieldData(VersionInfo $versionInfo, Field $field)
    {
        $storage = $this->storageRegistry->getStorage($field->type);
        if ($storage->hasFieldData()) {
            $storage->getFieldData($versionInfo, $field, $this->context);
        }
    }

Usage Example

 /**
  * Performs external loads for the fields in $content
  *
  * @param Content $content
  *
  * @return void
  */
 public function loadExternalFieldData(Content $content)
 {
     foreach ($content->fields as $field) {
         $this->storageHandler->getFieldData($content->versionInfo, $field);
     }
 }