GDS\Mapper\ProtoBuf::mapOneFromResult PHP Method

mapOneFromResult() public method

Map a single result out of the Raw response data into a supplied Entity object
public mapOneFromResult ( google\appengine\datastore\v4\EntityResult $obj_result ) : Entity
$obj_result google\appengine\datastore\v4\EntityResult
return GDS\Entity
    public function mapOneFromResult($obj_result)
    {
        // Key & Ancestry
        list($obj_gds_entity, $bol_schema_match) = $this->createEntityWithKey($obj_result);
        // Properties
        $arr_property_definitions = $this->obj_schema->getProperties();
        foreach ($obj_result->getEntity()->getPropertyList() as $obj_property) {
            /* @var $obj_property \google\appengine\datastore\v4\Property */
            $str_field = $obj_property->getName();
            if ($bol_schema_match && isset($arr_property_definitions[$str_field])) {
                $obj_gds_entity->__set($str_field, $this->extractPropertyValue($arr_property_definitions[$str_field]['type'], $obj_property->getValue()));
            } else {
                $obj_gds_entity->__set($str_field, $this->extractPropertyValue(Schema::PROPERTY_DETECT, $obj_property->getValue()));
            }
        }
        return $obj_gds_entity;
    }