eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler::loadExternalFieldData PHP Method

loadExternalFieldData() public method

Performs external loads for the fields in $content.
public loadExternalFieldData ( eZ\Publish\SPI\Persistence\Content $content )
$content eZ\Publish\SPI\Persistence\Content
    public function loadExternalFieldData(Content $content)
    {
        foreach ($content->fields as $field) {
            $this->storageHandler->getFieldData($content->versionInfo, $field);
        }
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Returns the raw data of a content object identified by $id, in a struct.
  *
  * A version to load must be specified. If you want to load the current
  * version of a content object use SearchHandler::findSingle() with the
  * ContentId criterion.
  *
  * Optionally a translation filter may be specified. If specified only the
  * translations with the listed language codes will be retrieved. If not,
  * all translations will be retrieved.
  *
  * @param int|string $id
  * @param int|string $version
  * @param string[] $translations
  *
  * @return \eZ\Publish\SPI\Persistence\Content Content value object
  */
 public function load($id, $version, array $translations = null)
 {
     $rows = $this->contentGateway->load($id, $version, $translations);
     if (empty($rows)) {
         throw new NotFound('content', "contentId: {$id}, versionNo: {$version}");
     }
     $contentObjects = $this->mapper->extractContentFromRows($rows, $this->contentGateway->loadVersionedNameData(array(array('id' => $id, 'version' => $version))));
     $content = $contentObjects[0];
     $this->fieldHandler->loadExternalFieldData($content);
     return $content;
 }