コード例 #1
0
 /** GET MESSAGES AND STORAGE**/
 public function getMessages()
 {
     $result = array();
     while ($this->managerWhats->pollMessage()) {
         $data = $this->managerWhats->getMessages();
         foreach ($data as $message) {
             $userSendMessage = $message->getAttribute('from');
             list($number, $whatsAppUrl) = explode('@', $userSendMessage);
             $result[$userSendMessage]['userSend'] = $message->getAttribute('notify');
             if ($message->getChild('media')) {
                 $mess = $message->getChild("media");
                 //$mess = $message->getChild("enc");
                 $result[$userSendMessage]['messages'][] = $mess->getAttribute('url');
                 $this->storageMessage($this->users->getNmWhatsapp(), $number, $mess->getAttribute('url'), false, true, $message->getAttribute('notify'));
                 if (!empty($mess->getAttribute('caption'))) {
                     $this->storageMessage($this->users->getNmWhatsapp(), $number, $mess->getAttribute('caption'), false, false, $message->getAttribute('notify'));
                 }
             } else {
                 $mess = $message->getChild("body");
                 //$mess = $message->getChild("enc");
                 $result[$userSendMessage]['messages'][] = $mess->getData();
                 $this->storageMessage($this->users->getNmWhatsapp(), $number, $mess->getData(), false, false, $message->getAttribute('notify'));
             }
         }
     }
     return $result;
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  */
 public function getIdStatusUsuarios()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getIdStatusUsuarios', array());
     return parent::getIdStatusUsuarios();
 }