當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UUID::convert方法代碼示例

本文整理匯總了PHP中UUID::convert方法的典型用法代碼示例。如果您正苦於以下問題:PHP UUID::convert方法的具體用法?PHP UUID::convert怎麽用?PHP UUID::convert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UUID的用法示例。


在下文中一共展示了UUID::convert方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
 }
開發者ID:jlaprise,項目名稱:Pandra,代碼行數:18,代碼來源:SuperColumnFamily.class.php

示例2: remove

 public static function remove($id)
 {
     try {
         self::$cfAddress->remove('hasan', UUID::convert($id, UUID::FMT_STRING, UUID::FMT_BINARY));
         return true;
     } catch (Exception $e) {
         var_dump($e);
         return false;
     }
 }
開發者ID:WellTreatUs,項目名稱:php_cassandra_example,代碼行數:10,代碼來源:services.php

示例3: testUUID

 static function testUUID()
 {
     $id = UUID::generate(UUID::UUID_TIME, UUID::FMT_STRING, 'node', 'ns');
     echo "{$id}\n";
     $id = UUID::generate(UUID::UUID_TIME, UUID::FMT_STRING, 'node', 'ns');
     echo "{$id}\n";
     $id = UUID::generate(UUID::UUID_TIME, UUID::FMT_STRING, 'node', 'ns');
     echo "{$id}\n";
     $packid = UUID::convert($id, UUID::FMT_STRING, UUID::FMT_BINARY);
     echo strlen($packid) . "\n";
     echo UUID::convert($packid, UUID::FMT_BINARY, UUID::FMT_STRING) . "\n";
 }
開發者ID:uning,項目名稱:backend_common,代碼行數:12,代碼來源:test.php

示例4: testSaveLoadDeleteUUID

 public function testSaveLoadDeleteUUID()
 {
     $cf = new PandraColumnFamily($this->_keyID, 'Keyspace1', 'StandardByUUID1', PandraColumnContainer::TYPE_UUID);
     $column = $cf->addColumn(UUID::v1());
     $uuidName = UUID::convert($column->getName(), UUID_FMT_STR);
     $cValue = 'test value';
     $column->setValue($cValue);
     $this->assertTrue($cf->save());
     unset($cf);
     $newCF = new PandraColumnFamily($this->_keyID, 'Keyspace1', 'StandardByUUID1', PandraColumnContainer::TYPE_UUID);
     $newCF->load();
     $this->assertEquals($cValue, $newCF[$uuidName]);
 }
開發者ID:jlaprise,項目名稱:Pandra,代碼行數:13,代碼來源:PandraColumnFamilyTest.class.php

示例5: 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);
 }
開發者ID:jlaprise,項目名稱:Pandra,代碼行數:12,代碼來源:ColumnContainer.class.php

示例6: toGUID

 public function toGUID()
 {
     return UUID::convert($this->id, UUID::FMT_BINARY, UUID::FMT_STRING);
 }
開發者ID:WellTreatUs,項目名稱:php_cassandra_example,代碼行數:4,代碼來源:models.php

示例7: unparse_column_name

 public function unparse_column_name($column_name, $is_column = true)
 {
     if (!$this->parse_columns) {
         return $column_name;
     }
     if (!$column_name) {
         return NULL;
     }
     $type = $is_column ? $this->column_type : $this->subcolumn_type;
     if ($type == "LexicalUUIDType" || $type == "TimeUUIDType") {
         return UUID::convert($column_name, UUID::FMT_STRING, UUID::FMT_BINARY);
     } else {
         if ($type == "LongType") {
             return pack("LL", $column_name, 0);
             // FIXME: currently only supports 32 bit unsigned
         } else {
             return $column_name;
         }
     }
 }
開發者ID:p6,項目名稱:phpcassa,代碼行數:20,代碼來源:phpcassa.php

示例8: unparse_column_name

 public function unparse_column_name($column_name, $is_column = true)
 {
     if (!$this->parse_columns) {
         return $column_name;
     }
     if (!$column_name) {
         return NULL;
     }
     $type = $is_column ? $this->column_type : $this->subcolumn_type;
     if ($type == "LexicalUUIDType" || $type == "TimeUUIDType") {
         return UUID::convert($column_name, UUID::FMT_STRING, UUID::FMT_BINARY);
     } else {
         if ($type == "LongType") {
             return $this->pack_longtype($column_name);
         } else {
             return $column_name;
         }
     }
 }
開發者ID:hoan,項目名稱:phpcassa,代碼行數:19,代碼來源:phpcassa.php

示例9: 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;
         }
     }
 }
開發者ID:uning,項目名稱:backend_common,代碼行數:19,代碼來源:phpcassa.php


注:本文中的UUID::convert方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。