GDS\Mapper\RESTv1::mapOneFromResult PHP Метод

mapOneFromResult() публичный Метод

Map a single result out of the Raw response data array FROM Google TO a GDS Entity
public mapOneFromResult ( object $obj_result ) : Entity
$obj_result object
Результат GDS\Entity
    public function mapOneFromResult($obj_result)
    {
        // Key & Ancestry
        list($obj_gds_entity, $bol_schema_match) = $this->createEntityWithKey($obj_result);
        /** @var Entity $obj_gds_entity */
        // Properties
        if (isset($obj_result->entity->properties)) {
            $arr_property_definitions = $this->obj_schema->getProperties();
            foreach ($obj_result->entity->properties as $str_field => $obj_property) {
                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));
                } else {
                    $obj_gds_entity->__set($str_field, $this->extractPropertyValue(Schema::PROPERTY_DETECT, $obj_property));
                }
            }
        }
        // Done
        return $obj_gds_entity;
    }