本文整理汇总了PHP中UUID::create方法的典型用法代码示例。如果您正苦于以下问题:PHP UUID::create方法的具体用法?PHP UUID::create怎么用?PHP UUID::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fromStorageRow
public static function fromStorageRow(array $row, $obj = null)
{
/** @var $obj AbstractSummary */
$obj = parent::fromStorageRow($row, $obj);
$obj->summaryTargetId = UUID::create($row['rev_type_id']);
return $obj;
}
示例2: setLockInfo
/**
* Set lock for URI
*
* @param org.webdav.WebdavLock lock The lock object
* @param string[] tokens Optional lock-tokens to overwrite lock
* @return org.webdav.WebdavLock
* @throws org.webdav.OperationNotAllowedException
*/
public function setLockInfo($lock, $tokens = array())
{
$lockinfo = $this->getLockInfo($lock->getURI());
// There's already lock
if ($lockinfo !== NULL) {
// We have s/some lock token, so check if we can overwrite the lock
if (sizeof($tokens)) {
if (!in_array($lockinfo->getLockToken(), $tokens)) {
throw new OperationNotAllowedException('Can not refresh lock on ' . $lock->getURI() . ' with owner ' . $lock->getOwner());
}
} else {
if ($lock->getLockToken() != $lockinfo->getLockToken()) {
throw new OperationNotAllowedException('LOCK failed - invalid Token given ' . $lock->getLockToken());
}
}
}
$newOwner = $lock->getOwner();
// We can't set a lock where owner is empty
if (empty($newOwner)) {
throw new OperationNotAllowedException('Can not set lock with empty owner');
}
// Check token
if (empty($token)) {
$t = new OpaqueLockTocken(UUID::create());
}
// Set lock
$lock->setLockToken($t->toString());
$this->propStorage->setLock($lock->getURI(), $lock);
return $lock;
}