/** * Zwraca liczbę dubli * @param type $content * @param type $recipientId * @return integer */ private function _checkDoubles() { $model = new RecipientDuplicateMessages(); try { $count = $model->getAmountOfDuplicates($this->_messageContent->getContentToSend(), $this->_idRecipient); } catch (Exception $exc) { throw new Logic_Service_Exception("Cannot modify value of duplicate entry!", null, $exc); } $limits = Logic_Client::getInstance()->getServiceGroupLimits(); if (!is_null($limits['duplicate']) && $count > $limits['duplicate']) { $this->addCheckerError('Limit dubli dziennych został wyczerpany dla aktualnego odbiorcy!', __METHOD__); return false; } return true; }
/** * Wysyla wiadomosc tekstowa wygenerowana z szablonu na zadany numer telefonu * * Tresc SMS jest zapisana w logach w utajonej formie. * * @param string $clientHash hash identyfikujacy klienta * @param string $serviceHash hash identyfikujacy usluge * @param string $number numer telefonu odbiorcy * @param string $templateName nazwa szablonu * @param string $templateHash hash MD5 wersji tresci szablonu klienta * @param array $templateParams lista parametrow do templatki (klucz => wartosc) * @param array $templateParamsConfidental lista parametrow do templatki (utajone w logach) (klucz => wartosc) * @param string $templateContent nowa zawartosc szablonu * @throws SoapFault * @return object */ public function templateconfidental($phone_no, $templateName = null, $templateHash = null, array $templateParams = array(), array $templateParamsConfidental = array(), $templateContent = null) { if ($templateContent) { // normalizuje tresc szablonu do standardu SMS $stringHandler = new Logic_Sms_Content_String($templateContent); $templateContent = $stringHandler->getContentToSend(); } //$content = new Logic_WebService_Element_Template( $content = new Logic_Sms_Template_Smarty($this->_getClient()->getParams()->id, $templateName, $templateHash, $templateParams, $templateParamsConfidental, $templateContent); $response = $this->text($phone_no, $content); if ($content->isMessage()) { $response->messages = $content->getMessages(); } return $response; }
public function textconfidental($phone_no, $content, $options) { if (false === $content instanceof Logic_Sms_Content_String) { $content = new Logic_Sms_Content_String($content); } $content->setConfidentality(true); return $this->text($phone_no, $content, $options); }