PHP Class pocketmine\metadata\MetadataStore

Afficher le fichier Open project: ClearSkyTeam/ClearSky Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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
Résultat string

getMetadata() public méthode

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
Résultat MetadataValue[]

hasMetadata() public méthode

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

invalidateAll() public méthode

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 méthode

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 méthode

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