1
私はgoogle datastoreに取り組んでいます。私はuser
エンティティを親として持つLog
種類のエンティティを作成する必要があります。私はPHPでAPIを統合するためにGoogle-api-php-clientライブラリを使用しています。私はエンタテイメントの作成に成功しています。エンティティを挿入するには、次の関数を使用しています。phpを使用してエンティティ(Googleデータストア)の祖先を作成するにはどうすればよいですか?
/*
*Function to insert the entity into the google datastore.
*/
function google_set_insert($data) {
$field_set = $data['field_set'];
$entity_kind = $data['entity_kind'];
$entity_name = $data['entity_name'];
$entity = google_create_entity($field_set, $entity_kind, $entity_name);
$mutation = new Google_Service_Datastore_Mutation();
$mutation->setInsert($entity);
$req = new Google_Service_Datastore_CommitRequest();
$req->setMode('NON_TRANSACTIONAL');
$req->setMutations($mutation);
return $req;
}
しかし、エンティティの祖先を作成できません。私が逃していることを教えてもらえますか?
GAE標準では、祖先をサポートするPHP-GDSライブラリを使用できます。 https://github.com/tomwalder/php-gds – Tom