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


PHP Uuid::toString方法代码示例

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


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

示例1: getEntryForMessageId

 /**
  * @param Uuid $messageId
  * @return null|MessageLogEntry
  */
 public function getEntryForMessageId(Uuid $messageId)
 {
     if (isset($this->entriesByMessageId[$messageId->toString()])) {
         return $this->entriesByMessageId[$messageId->toString()];
     }
     $query = $this->connection->createQueryBuilder();
     $query->select('*')->from(self::TABLE_NAME)->where($query->expr()->eq('message_id', ':message_id'));
     $query->setParameter('message_id', $messageId->toString());
     $entryData = $query->execute()->fetch(\PDO::FETCH_ASSOC);
     if (!$entryData) {
         return null;
     }
     $entry = MessageLogEntry::fromArray($entryData);
     $this->entriesByMessageId[$messageId->toString()] = $entry;
     return $entry;
 }
开发者ID:prooph,项目名称:link-processor-proxy,代码行数:20,代码来源:DbalMessageLogger.php

示例2: find

 /**
  * @param Uuid $id
  */
 public function find(Uuid $id)
 {
     $teamMember = $this->database->getRecord('SELECT *
            FROM team_members
           WHERE id = :id', ['id' => $id->getBytes()]);
     if (empty($teamMember)) {
         throw new \Exception('No teammember with id ' . $id->toString() . 'found');
     }
     return TeamMember::fromArray($teamMember);
 }
开发者ID:WouterSioen,项目名称:fork-cms-module-team,代码行数:13,代码来源:TeamMemberRepository.php

示例3: hasAssetMapping

 /**
  * {@inheritdoc}
  */
 public function hasAssetMapping(Uuid $uuid)
 {
     $expr = Expr::method('getUuid', Expr::method('toString', Expr::same($uuid->toString())))->andX($this->exprBuilder->buildExpression());
     return $this->discoveryManager->hasBindingDescriptors($expr);
 }
开发者ID:SenseException,项目名称:manager,代码行数:8,代码来源:DiscoveryAssetManager.php

示例4: serializeUuid

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

示例5: __toString

 /**
  * Return the object as a string
  *
  * @return string
  */
 public function __toString()
 {
     return $this->value->toString();
 }
开发者ID:snb4crazy,项目名称:cribbb,代码行数:9,代码来源:CribbbId.php

示例6: getBinding

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

示例7: 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:ikwattro,项目名称:discovery,代码行数:21,代码来源:KeyValueStoreDiscovery.php

示例8: testActionId

 public function testActionId()
 {
     $this->assertEquals($this->uuid->toString(), $this->command->actionId()->toString());
 }
开发者ID:gingerwfms,项目名称:ginger-workflow-engine,代码行数:4,代码来源:ActionTest.php

示例9: contains

 /**
  * Returns whether a binding descriptor exists.
  *
  * @param Uuid $uuid The UUID of the binding descriptor.
  *
  * @return bool Returns `true` if a binding descriptor was set for the given
  *              UUID.
  */
 public function contains(Uuid $uuid)
 {
     return isset($this->map[$uuid->toString()]);
 }
开发者ID:SenseException,项目名称:manager,代码行数:12,代码来源:BindingDescriptorCollection.php

示例10: uuid

 private function uuid(Uuid $uuid)
 {
     return $this->defaultExpr()->andSame($uuid->toString(), BindingDescriptor::UUID);
 }
开发者ID:niklongstone,项目名称:manager,代码行数:4,代码来源:DiscoveryAssetManagerTest.php

示例11: getValue

 public function getValue()
 {
     return $this->uuid->toString();
 }
开发者ID:php-xapi,项目名称:model,代码行数:4,代码来源:StatementId.php

示例12: setUp

 protected function setUp()
 {
     $this->uuid = Uuid::uuid4();
     $this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
     $this->command = DoSomething::fromArray(['message_name' => 'TestCommand', 'uuid' => $this->uuid->toString(), 'version' => 1, 'created_at' => $this->createdAt, 'payload' => ['command' => 'payload'], 'metadata' => ['command' => 'metadata']]);
 }
开发者ID:MattKetmo,项目名称:common,代码行数:6,代码来源:CommandTest.php

示例13: 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:ikwattro,项目名称:discovery,代码行数:12,代码来源:NoSuchBindingException.php

示例14: hasBindingDescriptor

 /**
  * Returns whether the binding descriptor exists in this file.
  *
  * @param Uuid $uuid The UUID of the binding descriptor.
  *
  * @return bool Whether the file contains the binding descriptor.
  */
 public function hasBindingDescriptor(Uuid $uuid)
 {
     return isset($this->bindingDescriptors[$uuid->toString()]);
 }
开发者ID:kormik,项目名称:manager,代码行数:11,代码来源:PackageFile.php

示例15: setUp

 protected function setUp()
 {
     $this->uuid = Uuid::uuid4();
     $this->createdAt = new \DateTimeImmutable();
     $this->domainEvent = SomethingWasDone::fromArray(['message_name' => 'TestDomainEvent', 'uuid' => $this->uuid->toString(), 'version' => 1, 'created_at' => $this->createdAt->format(\DateTime::ISO8601), 'payload' => ['event' => 'payload'], 'metadata' => ['event' => 'metadata']]);
 }
开发者ID:prolic,项目名称:common,代码行数:6,代码来源:DomainEventTest.php


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