uuidfactoryinterface.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. .. _reference.uuidfactoryinterface:
  2. ====================
  3. UuidFactoryInterface
  4. ====================
  5. .. php:namespace:: Ramsey\Uuid
  6. .. php:interface:: UuidFactoryInterface
  7. Represents a UUID factory.
  8. .. php:method:: getValidator()
  9. :returntype: Ramsey\\Uuid\\Validator\\ValidatorInterface
  10. .. php:method:: uuid1([$node[, $clockSeq]])
  11. Generates a version 1, Gregorian time UUID. See :ref:`rfc4122.version1`.
  12. :param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
  13. :param int|null $clockSeq: An optional clock sequence to use
  14. :returns: A version 1 UUID
  15. :returntype: Ramsey\\Uuid\\Rfc4122\\UuidV1
  16. .. php:method:: uuid2($localDomain[, $localIdentifier[, $node[, $clockSeq]]])
  17. Generates a version 2, DCE Security UUID. See :ref:`rfc4122.version2`.
  18. :param int $localDomain: The local domain to use (one of :php:const:`Uuid::DCE_DOMAIN_PERSON`, :php:const:`Uuid::DCE_DOMAIN_GROUP`, or :php:const:`Uuid::DCE_DOMAIN_ORG`)
  19. :param Ramsey\\Uuid\\Type\\Integer|null $localIdentifier: A local identifier for the domain (defaults to system UID or GID for *person* or *group*)
  20. :param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
  21. :param int|null $clockSeq: An optional clock sequence to use
  22. :returns: A version 2 UUID
  23. :returntype: Ramsey\\Uuid\\Rfc4122\\UuidV2
  24. .. php:method:: uuid3($ns, $name)
  25. Generates a version 3, name-based (MD5) UUID. See :ref:`rfc4122.version3`.
  26. :param Ramsey\\Uuid\\UuidInterface|string $ns: The namespace for this identifier
  27. :param string $name: The name from which to generate an identifier
  28. :returns: A version 3 UUID
  29. :returntype: Ramsey\\Uuid\\Rfc4122\\UuidV3
  30. .. php:method:: uuid4()
  31. Generates a version 4, random UUID. See :ref:`rfc4122.version4`.
  32. :returns: A version 4 UUID
  33. :returntype: Ramsey\\Uuid\\Rfc4122\\UuidV4
  34. .. php:method:: uuid5($ns, $name)
  35. Generates a version 5, name-based (SHA-1) UUID. See :ref:`rfc4122.version5`.
  36. :param Ramsey\\Uuid\\UuidInterface|string $ns: The namespace for this identifier
  37. :param string $name: The name from which to generate an identifier
  38. :returns: A version 5 UUID
  39. :returntype: Ramsey\\Uuid\\Rfc4122\\UuidV5
  40. .. php:method:: uuid6([$node[, $clockSeq]])
  41. Generates a version 6, reordered time UUID. See :ref:`rfc4122.version6`.
  42. :param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
  43. :param int|null $clockSeq: An optional clock sequence to use
  44. :returns: A version 6 UUID
  45. :returntype: Ramsey\\Uuid\\Rfc4122\\UuidV6
  46. .. php:method:: fromString($uuid)
  47. Creates an instance of UuidInterface from the string standard
  48. representation.
  49. :param string $uuid: The string standard representation of a UUID
  50. :returntype: Ramsey\\Uuid\\UuidInterface
  51. .. php:method:: fromBytes($bytes)
  52. Creates an instance of UuidInterface from a 16-byte string.
  53. :param string $bytes: A 16-byte binary string representation of a UUID
  54. :returntype: Ramsey\\Uuid\\UuidInterface
  55. .. php:method:: fromInteger($integer)
  56. Creates an instance of UuidInterface from a 128-bit string integer.
  57. :param string $integer: A 128-bit string integer representation of a UUID
  58. :returntype: Ramsey\\Uuid\\UuidInterface
  59. .. php:method:: fromDateTime($dateTime[, $node[, $clockSeq]])
  60. Creates a version 1 UUID instance from a `DateTimeInterface
  61. <https://www.php.net/datetimeinterface>`_ instance.
  62. :param DateTimeInterface $dateTime: The date from which to create the UUID instance
  63. :param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
  64. :param int|null $clockSeq: An optional clock sequence to use
  65. :returns: A version 1 UUID
  66. :returntype: Ramsey\\Uuid\\Rfc4122\\UuidV1