这里列的列表是类型array。列至少需要这些属性:
- 塔的
name
- 列的
type
( “日期时间”, “地点”, “数字” 或 “STRING”)
当您使用谷歌PHP API客户端一列由通过阵列传递他们预计的Google_Service_Fusiontables_Column
您可以直接设置所需的属性实例构造函数:
new Google_Service_Fusiontables_Column(array('type'=>'STRING','name'=>'desiredColumName'));
一个完整的创建表(2列)的是这样的:
//create FusionTable-instance
$table = new Google_Service_Fusiontables_Table;
//set table-name
$table->setName('myTableName');
//set required option isExportable
$table->setIsExportable('true');
//set column(s)
$table->setColumns(array(
new Google_Service_Fusiontables_Column(array('type'=>'STRING',
'name'=>'columnName')),
new Google_Service_Fusiontables_Column(array('type'=>'NUMBER',
'name'=>'otherName'))
)
);
//insert the table
//$service is a Google_Service_Fusiontables-instance
$result = $service->table->insert($table);
//display Id of the new FusionTable
echo $result->tableId;
你确定你正在阅读的PHP文件 – RiggsFolly
没有,但可以去看没有PHP文档 –