本文整理匯總了PHP中UUID::isBinary方法的典型用法代碼示例。如果您正苦於以下問題:PHP UUID::isBinary方法的具體用法?PHP UUID::isBinary怎麽用?PHP UUID::isBinary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UUID
的用法示例。
在下文中一共展示了UUID::isBinary方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addSuper
/**
* Helper function to add a Super Column instance to this Super Column Family
* addSuper overrides the parent container reference in the object instance
* To add the same supercolumn instance to multiple columnfamilies, use object clones
* instead.
* @param PandraSuperColumn $scObj
* @return PandraSuperColumn
*/
public function addSuper(PandraSuperColumn $scObj)
{
$superName = $scObj->getName();
if ($this->getType() == self::TYPE_UUID && !UUID::isBinary($scObj->getName())) {
$scObj->setName(UUID::convert($scObj->getName(), UUID::UUID_FMT_BIN));
}
$scObj->setParent($this, false);
$this->_columns[$superName] = $scObj;
return $this->getColumn($superName);
}
示例2: columnIn
/**
* Determins if column name exists in children at depth 1
* @param string $columnName column name
* @return bool column exists
*/
public function columnIn($columnName)
{
if (UUID::isBinary($columnName)) {
$columnName = UUID::convert($columnName, UUID::UUID_FMT_STR);
}
return array_key_exists($columnName, $this->_columns);
}
示例3: unparse_column_name
protected static function unparse_column_name($column_name, $type = CassandraCF::CT_BytesType)
{
if (!$column_name) {
return NULL;
}
if (UUID::isBinary($column_name)) {
return $column_name;
}
if ($type == self::CT_TimeUUIDType || $type == self::CT_LexicalUUIDType) {
return UUID::convert($column_name, UUID::FMT_STRING, UUID::FMT_BINARY);
} else {
if ($type == self::CT_LongType) {
return pack("N2", $column_name, 0);
// FIXME: currently only supports 32 bit unsigned
} else {
return $column_name;
}
}
}