src/GcpBaseCall.php
protected function getAffinityKeyFromProto($proto)
    {
        if ($this->_affinity) {
            $names = $this->_affinity['affinityKey'];
            $names_arr = explode(".", $names);
            foreach ($names_arr as $name) {
                $getAttrMethod = 'get' . ucfirst($name);
                $proto = call_user_func_array(array($proto, $getAttrMethod), array());
            }
            return $proto;
        }
        echo "Cannot find the field in the proto\n";
    }
protected function getAffinityKeyFromProto($proto)
    {
        if ($this->_affinity) {
            $names = $this->_affinity['affinityKey'];
            $names_arr = explode(".", $names);
            foreach ($names_arr as $name) {
                $getAttrMethod = 'get' . ucfirst($name);
                $proto = call_user_func_array(array($proto, $getAttrMethod), array());
            }
            return $proto;
        }
        echo "Cannot find the field in the proto\n";
    }
protected function getAffinityKeyFromProto ( $ proto ) { if ( $ this -> _affinity ) { $ names = $ this -> _affinity [ 'affinityKey' ] ; $ names_arr = explode ( "." , $ names ) ; foreach ( $ names_arr as $ name ) { $ getAttrMethod = 'get' . ucfirst ( $ name ) ; $ proto = call_user_func_array ( array ( $ proto , $ getAttrMethod ) , array ( ) ) ; } return $ proto ; } echo "Cannot find the field in the proto\n" ; }
Get the affinity key based on the affinity config.

@param mixed $proto Objects may contain the affinity key.

@return string Affinity key.
Get the affinity key based on the affinity config .