|
|
@ -131,6 +131,8 @@ abstract class AbstractCall |
|
|
|
// Proto3 implementation |
|
|
|
// Proto3 implementation |
|
|
|
if (method_exists($data, 'encode')) { |
|
|
|
if (method_exists($data, 'encode')) { |
|
|
|
return $data->encode(); |
|
|
|
return $data->encode(); |
|
|
|
|
|
|
|
} else if (method_exists($data, 'serializeToString')) { |
|
|
|
|
|
|
|
return $data->serializeToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Protobuf-PHP implementation |
|
|
|
// Protobuf-PHP implementation |
|
|
@ -154,7 +156,11 @@ abstract class AbstractCall |
|
|
|
if (is_array($this->deserialize)) { |
|
|
|
if (is_array($this->deserialize)) { |
|
|
|
list($className, $deserializeFunc) = $this->deserialize; |
|
|
|
list($className, $deserializeFunc) = $this->deserialize; |
|
|
|
$obj = new $className(); |
|
|
|
$obj = new $className(); |
|
|
|
$obj->$deserializeFunc($value); |
|
|
|
if (method_exists($obj, $deserializeFunc)) { |
|
|
|
|
|
|
|
$obj->$deserializeFunc($value); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$obj->mergeFromString($value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $obj; |
|
|
|
return $obj; |
|
|
|
} |
|
|
|
} |
|
|
|