function create_entity()
{
    $entity = new Google_Service_Datastore_Entity();
    $entity->setKey(createKeyForTestItem());
    $string_prop = new Google_Service_Datastore_Property();
    $string_prop->setStringValue("test field string value");
    $property_map = [];
    $property_map["testfield"] = $string_prop;
    $entity->setProperties($property_map);
    return $entity;
}
Beispiel #2
0
function create_entity($hashkey, $text)
{
    $entity = new Google_Service_Datastore_Entity();
    $entity->setKey(createKeyForTestItem());
    $string_prop_hash = new Google_Service_Datastore_Property();
    $string_prop_hash->setStringValue($hashkey);
    $string_prop_text = new Google_Service_Datastore_Property();
    $string_prop_text->setStringValue($text);
    $property_map = [];
    $property_map["hash"] = $string_prop_hash;
    $property_map["text"] = $string_prop_text;
    $entity->setProperties($property_map);
    return $entity;
}