Beispiel #1
0
 /**
  * @param integer $id Identyfikator maski
  * @return array
  */
 public function getServiceMasks($ids)
 {
     $serviceModel = new WsServiceSms();
     $ids = $ids === null ? $ids : array_filter($ids);
     $dict = new Base_Dictionary();
     if (empty($ids)) {
         return $dict->setSource('mask')->getDictionary();
     }
     $select = $serviceModel->select()->where("id IN (" . implode(',', $ids) . ")")->where("ghost = ?", 'FALSE');
     $serviceRows = $serviceModel->fetchAll($select);
     foreach ($serviceRows as $key => $serviceRow) {
         if ($key == 0) {
             $masks = $serviceRow->getMasks();
         } else {
             $maskTmp = $serviceRow->getMasks();
             $masks = array_intersect($masks, $serviceRow->getMasks());
         }
     }
     if (empty($masks)) {
         throw new Logic_Exception("Brak masek dla wskazanej usługi!");
     }
     $dicEntry = $dict->setSource('mask')->getDictionary();
     if (true === empty($dicEntry)) {
         throw new Logic_Exception("Brak wprowadzonych masek w aplikacji!");
     }
     foreach ($masks as $maskId) {
         $available[$maskId] = $dicEntry[$maskId];
     }
     return $available;
 }
Beispiel #2
0
 public function getDependentServices()
 {
     $model = new WsServiceSms();
     $select = $model->select()->setIntegrityCheck(false)->from(array('wss' => 'service_sms'), array('*'), 'ws')->joinLeft(array('smec' => 'multiinfo_error_config'), 'smec.service_id = wss.id', array(), 'sms')->where('wss.ghost = ?', 'false')->where('smec.dict_id = ?', $this->dict_id);
     $rowSet = $model->fetchAll($select);
     return $rowSet;
 }