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


PHP Type::map方法代碼示例

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


在下文中一共展示了Type::map方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: nestedCassandraTypes

 /**
  * Nested composite Cassandra types (list, map, set, tuple, and UDT) to be
  * used by data providers
  */
 public function nestedCassandraTypes()
 {
     $compositeCassandraTypes = $this->compositeCassandraTypes();
     foreach ($compositeCassandraTypes as $nestedType) {
         $type = Type::collection($nestedType[0]);
         $nestedCassandraTypes[] = array($type, array($type->create($nestedType[1][0])));
     }
     foreach ($compositeCassandraTypes as $nestedType) {
         $type = Type::set($nestedType[0]);
         $nestedCassandraTypes[] = array($type, array($type->create($nestedType[1][0])));
     }
     foreach ($compositeCassandraTypes as $nestedType) {
         $type = Type::map($nestedType[0], $nestedType[0]);
         $nestedCassandraTypes[] = array($type, array($type->create($nestedType[1][0], $nestedType[1][1])));
     }
     foreach ($compositeCassandraTypes as $nestedType) {
         $type = Type::tuple($nestedType[0], $nestedType[0]);
         $nestedCassandraTypes[] = array($type, array($type->create($nestedType[1][0], $nestedType[1][1])));
     }
     foreach ($compositeCassandraTypes as $nestedType) {
         $type = Type::userType("a", $nestedType[0], "b", $nestedType[0]);
         $type = $type->withName(self::userTypeString($type));
         $nestedCassandraTypes[] = array($type, array($type->create("a", $nestedType[1][0], "b", $nestedType[1][1])));
     }
     return $nestedCassandraTypes;
 }
開發者ID:harley84,項目名稱:php-driver,代碼行數:30,代碼來源:CollectionsIntegrationTest.php

示例2: compositeTypes

 public function compositeTypes()
 {
     $map_type = Type::map(Type::varchar(), Type::varchar());
     $set_type = Type::set(Type::varchar());
     $list_type = Type::collection(Type::varchar());
     $tuple_type = Type::tuple(Type::varchar(), Type::int());
     return array(array($map_type, $map_type->create("a", "1", "b", "2")), array($set_type, $set_type->create("a", "b", "c")), array($list_type, $list_type->create("a", "b", "c")), array($tuple_type, $tuple_type->create("a", 42)));
 }
開發者ID:datastax,項目名稱:php-driver,代碼行數:8,代碼來源:TupleTest.php

示例3: compositeTypes

 public function compositeTypes()
 {
     return array(array(Type::map(Type::varchar(), Type::varchar())), array(Type::set(Type::varchar())), array(Type::collection(Type::varchar())));
 }
開發者ID:harley84,項目名稱:php-driver,代碼行數:4,代碼來源:CollectionTest.php

示例4: testEmpty

 /**
  * Bind statement with an null map
  */
 public function testEmpty()
 {
     $mapType = Type::map(Type::int(), Type::int());
     $this->createTableInsertAndVerifyValueByIndex($mapType, null);
     $this->createTableInsertAndVerifyValueByName($mapType, null);
 }
開發者ID:datastax,項目名稱:php-driver,代碼行數:9,代碼來源:MapIntegrationTest.php

示例5: getTypeName

 /**
  * Return the variable type name
  * @return string The value of the type (@see Type::map)
  */
 public function getTypeName()
 {
     return Type::map($this->type);
 }
開發者ID:g4z,項目名稱:poop,代碼行數:8,代碼來源:Variable.php

示例6: baseColumnType

 /**
  * Returns the base type name for the provided column.
  * This represent the schema type a more complex class is
  * based upon.
  *
  * @param string $column The column name to get the base type from
  * @return string The base type name
  */
 public function baseColumnType($column)
 {
     if (isset($this->_columns[$column]['baseType'])) {
         return $this->_columns[$column]['baseType'];
     }
     $type = $this->columnType($column);
     if ($type === null) {
         return null;
     }
     if (Type::map($type)) {
         $type = Type::build($type)->getBaseType();
     }
     return $this->_columns[$column]['baseType'] = $type;
 }
開發者ID:CVO-Technologies,項目名稱:cakephp-webservice,代碼行數:22,代碼來源:Schema.php


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