当前位置: 首页>>代码示例>>PHP>>正文


PHP Uuid::toString方法代码示例

本文整理汇总了PHP中Ramsey\Uuid\Uuid::toString方法的典型用法代码示例。如果您正苦于以下问题:PHP Uuid::toString方法的具体用法?PHP Uuid::toString怎么用?PHP Uuid::toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ramsey\Uuid\Uuid的用法示例。


在下文中一共展示了Uuid::toString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getBinding

 /**
  * {@inheritdoc}
  */
 public function getBinding(Uuid $uuid)
 {
     if (!isset($this->keysByUuid[$uuid->toString()])) {
         throw NoSuchBindingException::forUuid($uuid);
     }
     $key = $this->keysByUuid[$uuid->toString()];
     if (!isset($this->bindingsByKey[$key])) {
         $this->loadBindingsForKey($key);
     }
     foreach ($this->bindingsByKey[$key] as $binding) {
         if ($binding->getUuid()->equals($uuid)) {
             return $binding;
         }
     }
     // This does not happen except if someone plays with the key-value store
     // contents (or there's a bug here..)
     throw new RuntimeException('The discovery is corrupt. Please rebuild it.');
 }
开发者ID:Nyholm,项目名称:discovery-1,代码行数:21,代码来源:KeyValueStoreDiscovery.php

示例2: toString

 /**
  * @return string
  */
 public function toString()
 {
     return static::toOrderedUuid($this->uuid->toString());
 }
开发者ID:charlydagos,项目名称:optimized-uuid,代码行数:7,代码来源:OptimizedUuid.php

示例3: forUuid

 /**
  * Creates an exception for a UUID.
  *
  * @param Uuid           $uuid  The UUID of the binding.
  * @param Exception|null $cause The exception that caused this exception.
  *
  * @return static The created exception.
  */
 public static function forUuid(Uuid $uuid, Exception $cause = null)
 {
     return new static(sprintf('The binding "%s" does not exist.', $uuid->toString()), 0, $cause);
 }
开发者ID:Nyholm,项目名称:discovery-1,代码行数:12,代码来源:NoSuchBindingException.php

示例4: serialize

 /**
  * Serializes the uuid.
  * @param VisitorInterface $visitor
  * @param Uuid $uuid
  * @return string
  */
 public function serialize(VisitorInterface $visitor, Uuid $uuid)
 {
     return $uuid->toString();
 }
开发者ID:palya-framework,项目名称:palya,代码行数:10,代码来源:UuidHandler.php

示例5: getBinding

 /**
  * {@inheritdoc}
  */
 public function getBinding(Uuid $uuid)
 {
     if (!isset($this->bindings[$uuid->toString()])) {
         throw NoSuchBindingException::forUuid($uuid);
     }
     return $this->bindings[$uuid->toString()];
 }
开发者ID:Nyholm,项目名称:discovery-1,代码行数:10,代码来源:InMemoryDiscovery.php

示例6: preSerialize

 protected function preSerialize(array &$data)
 {
     $data[] = $this->typeName;
     $data[] = $this->userParameterValues;
     $data[] = $this->uuid->toString();
 }
开发者ID:Nyholm,项目名称:discovery-1,代码行数:6,代码来源:AbstractBinding.php

示例7: optionalAutomaticAction

 /**
  * @Route("/optionalAutomatic/{uuid}")
  */
 public function optionalAutomaticAction(Uuid $uuid = null)
 {
     return new Response($uuid ? $uuid->toString() : null);
 }
开发者ID:mcfedr,项目名称:uuid-paramconverter,代码行数:7,代码来源:TestController.php

示例8: __toString

 /**
  * @return string
  */
 public function __toString()
 {
     return $this->value->toString();
 }
开发者ID:acairns,项目名称:sitepoint-command-bus,代码行数:7,代码来源:DeckId.php

示例9: serializeUuid

 public function serializeUuid(VisitorInterface $visitor, Uuid $uuid, array $type, Context $context)
 {
     return $visitor->visitString($uuid->toString(), $type, $context);
 }
开发者ID:dddinphp,项目名称:last-wishes-gamify,代码行数:4,代码来源:UuidHandler.php

示例10: getUuidString

 /**
  * @return null|string
  */
 public function getUuidString()
 {
     return $this->uuid ? $this->uuid->toString() : null;
 }
开发者ID:src-run,项目名称:arthur-doctrine-identity-library,代码行数:7,代码来源:UuidEntity.php

示例11: findMatchingRow

 /**
  * @param EntityManager $em
  * @param Uuid          $uuid
  *
  * @return bool
  */
 protected function findMatchingRow(EntityManager $em, Uuid $uuid)
 {
     return $em->find(self::$metadata->getName(), ['uuid' => $uuid->toString()]);
 }
开发者ID:scr-be,项目名称:arthur-doctrine-uuid-library,代码行数:10,代码来源:StringUuid4PessimisticGenerator.php

示例12: getId

 public function getId() : string
 {
     return $this->id->toString();
 }
开发者ID:ParalelniPolis,项目名称:bitcoinJukebox,代码行数:4,代码来源:Song.php

示例13: toString

 /**
  * @return string
  */
 public function toString()
 {
     return $this->uuid->toString();
 }
开发者ID:josecelano,项目名称:php-ddd-cargo-sample,代码行数:7,代码来源:TrackingId.php


注:本文中的Ramsey\Uuid\Uuid::toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。