本文整理匯總了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.');
}
示例2: toString
/**
* @return string
*/
public function toString()
{
return static::toOrderedUuid($this->uuid->toString());
}
示例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);
}
示例4: serialize
/**
* Serializes the uuid.
* @param VisitorInterface $visitor
* @param Uuid $uuid
* @return string
*/
public function serialize(VisitorInterface $visitor, Uuid $uuid)
{
return $uuid->toString();
}
示例5: getBinding
/**
* {@inheritdoc}
*/
public function getBinding(Uuid $uuid)
{
if (!isset($this->bindings[$uuid->toString()])) {
throw NoSuchBindingException::forUuid($uuid);
}
return $this->bindings[$uuid->toString()];
}
示例6: preSerialize
protected function preSerialize(array &$data)
{
$data[] = $this->typeName;
$data[] = $this->userParameterValues;
$data[] = $this->uuid->toString();
}
示例7: optionalAutomaticAction
/**
* @Route("/optionalAutomatic/{uuid}")
*/
public function optionalAutomaticAction(Uuid $uuid = null)
{
return new Response($uuid ? $uuid->toString() : null);
}
示例8: __toString
/**
* @return string
*/
public function __toString()
{
return $this->value->toString();
}
示例9: serializeUuid
public function serializeUuid(VisitorInterface $visitor, Uuid $uuid, array $type, Context $context)
{
return $visitor->visitString($uuid->toString(), $type, $context);
}
示例10: getUuidString
/**
* @return null|string
*/
public function getUuidString()
{
return $this->uuid ? $this->uuid->toString() : null;
}
示例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()]);
}
示例12: getId
public function getId() : string
{
return $this->id->toString();
}
示例13: toString
/**
* @return string
*/
public function toString()
{
return $this->uuid->toString();
}