GDS\Gateway\ProtoBuf::fetchByKeyPart PHP Method

fetchByKeyPart() protected method

Fetch 1-many Entities, using the Key parts provided
protected fetchByKeyPart ( array $arr_key_parts, $str_setter ) : Entity[] | null
$arr_key_parts array
$str_setter
return GDS\Entity[] | null
    protected function fetchByKeyPart(array $arr_key_parts, $str_setter)
    {
        $obj_request = $this->setupLookup();
        foreach ($arr_key_parts as $mix_key_part) {
            $obj_key = $obj_request->addKey();
            $this->applyNamespace($obj_key);
            $obj_kpe = $obj_key->addPathElement();
            $obj_kpe->setKind($this->obj_schema->getKind());
            $obj_kpe->{$str_setter}($mix_key_part);
        }
        $this->execute('Lookup', $obj_request, new LookupResponse());
        $arr_mapped_results = $this->createMapper()->mapFromResults($this->obj_last_response->getFoundList());
        $this->obj_schema = null;
        // Consume Schema
        return $arr_mapped_results;
    }