Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe DefaultTimeGenerator
+ Graphe d'héritage de DefaultTimeGenerator:

Fonctions membres publiques

 __construct (NodeProviderInterface $nodeProvider, TimeConverterInterface $timeConverter, TimeProviderInterface $timeProvider)
 
 generate ($node=null, $clockSeq=null)
 

Fonctions membres protégées

 getValidNode ($node)
 

Attributs privés

 $nodeProvider
 
 $timeConverter
 
 $timeProvider
 

Description détaillée

DefaultTimeGenerator provides functionality to generate strings of binary data for version 1 UUIDs based on a host ID, sequence number, and the current time

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( NodeProviderInterface  $nodeProvider,
TimeConverterInterface  $timeConverter,
TimeProviderInterface  $timeProvider 
)

Constructs a DefaultTimeGenerator using a node provider, time converter, and time provider

Paramètres
NodeProviderInterface$nodeProvider
TimeConverterInterface$timeConverter
TimeProviderInterface$timeProvider

Références DefaultTimeGenerator\$nodeProvider, DefaultTimeGenerator\$timeConverter, et DefaultTimeGenerator\$timeProvider.

Documentation des fonctions membres

◆ generate()

generate (   $node = null,
  $clockSeq = null 
)

Generate a version 1 UUID from a host ID, sequence number, and the current time

If $node is not given, we will attempt to obtain the local hardware address. If $clockSeq is given, it is used as the sequence number; otherwise a random 14-bit sequence number is chosen.

Paramètres
int | string$nodeA 48-bit number representing the hardware address This number may be represented as an integer or a hexadecimal string.
int$clockSeqA 14-bit number used to help avoid duplicates that could arise when the clock is set backwards in time or if the node ID changes.
Renvoie
string A binary string
Exceptions
UnsatisfiedDependencyExceptionif called on a 32-bit system and Moontoast\Math\BigNumber is not present
InvalidArgumentException
Exceptionif it was not possible to gather sufficient entropy

Implémente TimeGeneratorInterface.

Références BinaryUtils\applyVariant(), BinaryUtils\applyVersion(), DefaultTimeGenerator\getValidNode(), et null.

◆ getValidNode()

getValidNode (   $node)
protected

Uses the node provider given when constructing this instance to get the node ID (usually a MAC address)

Paramètres
string | int$nodeA node value that may be used to override the node provider
Renvoie
string Hexadecimal representation of the node ID
Exceptions
InvalidArgumentException
Exception

Références null.

Référencé par DefaultTimeGenerator\generate().

Documentation des champs

◆ $nodeProvider

$nodeProvider
private

◆ $timeConverter

$timeConverter
private

◆ $timeProvider

$timeProvider
private

La documentation de cette classe a été générée à partir du fichier suivant :