Example #1
0
 /**
  * @param mixed $content
  * @param boolean $isConfidentially czy tresc SMS jest poufna
  * @return void
  */
 public function __construct($content, $isConfidentially = false)
 {
     if (is_object($content)) {
         $this->_content = $content->generate();
         $this->_contentToLog = $isConfidentially ? $content->generate(true) : $this->_content;
     } elseif (is_string($content) && !empty($content)) {
         $string = new Logic_WebService_Sms_Content_String();
         $this->_content = $string->prepare($content);
         $this->_contentToLog = $isConfidentially ? '#### oznaczono jako poufne ####' : $this->_content;
     } else {
         throw new Logic_WebService_Sms_Exception('Nie podano tresci wiadomosci', 424);
     }
 }
Example #2
0
 /**
  * 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($clientHash = null, $serviceHash = null, $number = null, $templateName = null, $templateHash = null, array $templateParams = array(), array $templateParamsConfidental = array(), $templateContent = null)
 {
     try {
         $this->_init($clientHash, $serviceHash, 'templateconfidental', array('number' => $number, 'templateName' => $templateName, 'templateHash' => $templateHash, 'templateParams' => $templateParams, 'templateContent' => $templateContent), $this->_revision);
         if ($templateContent) {
             // normalizuje tresc szablonu do standardu SMS
             $stringHandler = new Logic_WebService_Sms_Content_String();
             $templateContent = $stringHandler->prepare($templateContent);
         }
         //$content = new Logic_WebService_Element_Template(
         $content = new Logic_WebService_Element_Template_Smarty($this->_getClient()->getParams()->id, $templateName, $templateHash, $templateParams, $templateParamsConfidental, $templateContent);
         $handler = Logic_WebService_Sms_Handler::getHandler($this->getCurrentOperatorId($serviceHash), 'SingleSms', $this->_getEnvironment(), $this->_getClient(), $this->_getService());
         $response = $handler->handle($number, $content, false, new Logic_Service_Multiinfo_Params(array('delivNotifRequest' => true)));
         if ($content->isMessage()) {
             $response->messages = $content->getMessages();
         }
         return $this->_responseHandler($response);
     } catch (Logic_WebService_Exception $e) {
         return $this->_faultHandler($e);
     } catch (Logic_Service_Exception $e) {
         return $this->_faultHandler($e);
     } catch (Exception $e) {
         return $this->_faultHandler($e);
     }
 }