function StageBase::getMetadata

Returns a specific piece of metadata associated with this stage.

Only the owner of the stage can access metadata, and the stage must either be claimed by its owner, or created during the current request.

Parameters

string $key: The metadata key.

Return value

mixed The metadata value, or NULL if it is not set.

File

core/modules/package_manager/src/StageBase.php, line 234

Class

StageBase
Creates and manages a stage directory in which to install or update code.

Namespace

Drupal\package_manager

Code

public function getMetadata(string $key) {
    $this->checkOwnership();
    $metadata = $this->tempStore
        ->get(static::TEMPSTORE_METADATA_KEY) ?: [];
    return $metadata[$key] ?? NULL;
}

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