public function encodeMessage($message)
    {
        // Get message descriptor
        $pool = DescriptorPool::getGeneratedPool();
        $messageType = $pool->getDescriptorByClassName(get_class($message));
        try {
            return $this->encodeMessageImpl($message, $messageType);
        } catch (\Exception $e) {
            throw new ValidationException(
                "Error encoding message: " . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
public function encodeMessage($message)
    {
        // Get message descriptor
        $pool = DescriptorPool::getGeneratedPool();
        $messageType = $pool->getDescriptorByClassName(get_class($message));
        try {
            return $this->encodeMessageImpl($message, $messageType);
        } catch (\Exception $e) {
            throw new ValidationException(
                "Error encoding message: " . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
public function encodeMessage ( $ message ) { // Get message descriptor $ pool = DescriptorPool :: getGeneratedPool ( ) ; $ messageType = $ pool -> getDescriptorByClassName ( get_class ( $ message ) ) ; try { return $ this -> encodeMessageImpl ( $ message , $ messageType ) ; } catch ( \ Exception $ e ) { throw new ValidationException ( "Error encoding message: " . $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } }
Encode protobuf message as a PHP array

@param mixed $message
@return array
@throws ValidationException
Encode protobuf message as a PHP array