class ExportResult

The result of exporting a content entity.

@internal This API is experimental.

Hierarchy

Expanded class hierarchy of ExportResult

File

core/lib/Drupal/Core/DefaultContent/ExportResult.php, line 15

Namespace

Drupal\Core\DefaultContent
View source
final readonly class ExportResult {
  public function __construct(public array $data, public ExportMetadata $metadata) {
  }
  
  /**
   * Returns the exported entity data as YAML.
   *
   * @return string
   *   The exported entity data in YAML format.
   */
  public function __toString() : string {
    $data = [
      '_meta' => $this->metadata
        ->get(),
    ] + $this->data;
    return Yaml::encode($data);
  }

}

Members

Title Sort descending Modifiers Object type Summary
ExportResult::__construct public function
ExportResult::__toString public function Returns the exported entity data as YAML.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.