GDS\Mapper\RESTv1::mapToGoogle PHP Method

mapToGoogle() public method

https://cloud.google.com/datastore/reference/rest/v1/Entity
public mapToGoogle ( Entity $obj_gds_entity ) : stdClass
$obj_gds_entity GDS\Entity
return stdClass
    public function mapToGoogle(Entity $obj_gds_entity)
    {
        // Base entity with key (partition applied later)
        $obj_rest_entity = (object) ['key' => (object) ['path' => $this->buildKeyPath($obj_gds_entity)], 'properties' => (object) []];
        // Properties
        $arr_field_defs = $this->bestEffortFieldDefs($obj_gds_entity);
        foreach ($obj_gds_entity->getData() as $str_field_name => $mix_value) {
            if (isset($arr_field_defs[$str_field_name])) {
                $obj_rest_entity->properties->{$str_field_name} = $this->createPropertyValue($arr_field_defs[$str_field_name], $mix_value);
            } else {
                $arr_dynamic_data = $this->determineDynamicType($mix_value);
                $obj_rest_entity->properties->{$str_field_name} = $this->createPropertyValue(['type' => $arr_dynamic_data['type'], 'index' => true], $arr_dynamic_data['value']);
            }
        }
        return $obj_rest_entity;
    }