/** * Send a message to the queue * * @param \ZendTest\Queue\Custom\Message|\ZendTest\Queue\Custom\Messages $message message * @return $this * @throws Zend_Queue_Exception */ public function send($message) { if (!($message instanceof Message || $message instanceof Messages)) { throw new \Zend\Queue\Exception('$message must be an instance of \\ZendTest\\Queue\\Custom\\Message or \\ZendTest\\Queue\\Custom\\Messages'); } if ($message instanceof Message) { $response = parent::send($message->__toString()); } else { foreach ($message as $i => $one) { $response = parent::send($one->__toString()); } } return $this; }