PHP Class pocketmine\metadata\MetadataStore

Show file Open project: ClearSkyTeam/ClearSky Class Usage Examples

Public Methods

Method Description
disambiguate ( pocketmine\metadata\Metadatable $subject, string $metadataKey ) : string Creates a unique name for the object receiving metadata by combining unique data from the subject with a metadataKey.
getMetadata ( mixed $subject, string $metadataKey ) : MetadataValue[] Returns all metadata values attached to an object. If multiple have attached metadata, each will value will be included.
hasMetadata ( mixed $subject, string $metadataKey ) : boolean Tests to see if a metadata attribute has been set on an object.
invalidateAll ( pocketmine\plugin\Plugin $owningPlugin ) Invalidates all metadata in the metadata store that originates from the given plugin. Doing this will force each invalidated metadata item to be recalculated the next time it is accessed.
removeMetadata ( mixed $subject, string $metadataKey, pocketmine\plugin\Plugin $owningPlugin ) Removes a metadata item owned by a plugin from a subject.
setMetadata ( mixed $subject, string $metadataKey, MetadataValue $newMetadataValue ) Adds a metadata value to an object.

Method Details

disambiguate() abstract public method

Creates a unique name for the object receiving metadata by combining unique data from the subject with a metadataKey.
abstract public disambiguate ( pocketmine\metadata\Metadatable $subject, string $metadataKey ) : string
$subject pocketmine\metadata\Metadatable
$metadataKey string
return string

getMetadata() public method

Returns all metadata values attached to an object. If multiple have attached metadata, each will value will be included.
public getMetadata ( mixed $subject, string $metadataKey ) : MetadataValue[]
$subject mixed
$metadataKey string
return MetadataValue[]

hasMetadata() public method

Tests to see if a metadata attribute has been set on an object.
public hasMetadata ( mixed $subject, string $metadataKey ) : boolean
$subject mixed
$metadataKey string
return boolean

invalidateAll() public method

Invalidates all metadata in the metadata store that originates from the given plugin. Doing this will force each invalidated metadata item to be recalculated the next time it is accessed.
public invalidateAll ( pocketmine\plugin\Plugin $owningPlugin )
$owningPlugin pocketmine\plugin\Plugin

removeMetadata() public method

Removes a metadata item owned by a plugin from a subject.
public removeMetadata ( mixed $subject, string $metadataKey, pocketmine\plugin\Plugin $owningPlugin )
$subject mixed
$metadataKey string
$owningPlugin pocketmine\plugin\Plugin

setMetadata() public method

Adds a metadata value to an object.
public setMetadata ( mixed $subject, string $metadataKey, MetadataValue $newMetadataValue )
$subject mixed
$metadataKey string
$newMetadataValue MetadataValue