protected function _deleteEricsson(SmsMsisdnModel $object)
 {
     $methodName = self::METHOD_NAME_DELETE;
     $proto = $this->_createProto($methodName);
     $proto->setMsisdn($object->id);
     $proto->setId($object->supplServicesId);
     $response = $this->_sendRequest($methodName, array('protoMessage' => $proto));
     $this->_checkDeleteResponse($response);
     $supplMapper = SupplServicesMapper::getInstance();
     $supplMapper->getCache()->remove($object->supplServicesId);
     return true;
 }
Пример #2
0
 /**
  * @param  string                      $id
  * @return \Application\Model\SimModel
  */
 public function load($id, $org = null, $idType = 'Id')
 {
     $mapper = $this->getMapper();
     $idType = ucfirst(strtolower($idType));
     $sim = $mapper->{'findOneBy' . $idType}($id);
     if (is_null($sim)) {
         return null;
     }
     //retrieve the restriction:
     $resMapper = \Application\Model\Mapper\RestrictionMapper::getInstance();
     $restrictions = $resMapper->findOneBySubscriptionId($sim->getId());
     if (!is_null($restrictions)) {
         $sim->setRestrictions($restrictions);
     }
     //retrive the customer supplservices
     if ($sim->getCustomer()) {
         $orgMapper = \Application\Model\Mapper\Organization\OrgCustomerMapper::getInstance();
         $customer = $orgMapper->findOneById($sim->getCustomer()->getId());
         $supplServicesMapper = \Application\Model\Mapper\SupplServicesMapper::getInstance();
         if ($customer->getSupplementaryServicesId()) {
             $supplServices = $supplServicesMapper->findOneById($customer->getSupplementaryServicesId());
             if (!is_null($supplServices)) {
                 $supplServices->setTariffs(array());
                 $sim->setCustomerSupplServices($supplServices);
             }
         }
     }
     // Grow the model with additional data
     try {
         $mapper->getConsumption($sim);
     } catch (\Exception $e) {
         \App::log()->warn($e);
     }
     try {
         $mapper->getLifeCycle($sim);
     } catch (\Exception $e) {
         \App::log()->warn($e);
     }
     try {
         $mapper->getPresenceDetails($sim);
     } catch (\Exception $e) {
         \App::log()->warn($e);
     }
     try {
         $mapper->getLocationDetails($sim);
     } catch (\Exception $e) {
         \App::log()->warn($e);
     }
     try {
         $mapper->getTimeAndConsumptionVoucher($sim);
     } catch (\Exception $e) {
         \App::log()->warn($e);
     }
     return $sim;
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_spMapper = \Application\Model\Mapper\SupplServicesMapper::getInstance();
     $supplJson = '
         {
             "name":"SupplServices 1",
             "description":"A supplServices for tests",
             "published":false,
             "currency":"978",
             "selfManagement":2,
             "vpnService":1,
             "advancedSupervision":2,
             "location":2,
             "dca":1,
             "dim":2,
             "supervisionLevel":1,
             "applicationOriginatedSmsMsisdn":"App 1",
             "tariffs":{
               "selfManagement":{
                 "transitions":{
                   "setup":1,
                   "termination":20,
                   "suspension":300,
                   "reactivation":4500
                 },
                 "customer":{
                   "monthlyActive":0,
                   "monthlySuspended":0
                 }
               },
               "vpn":{
                 "transitions":{
                   "setup":0,
                   "termination":0,
                   "suspension":0,
                   "reactivation":0
                 },
                 "customer":{
                   "monthlyActive":0,
                   "monthlySuspended":0,
                   "monthlyStaticIp":0,
                   "customApn":0
                 },
                 "subscription":{
                   "monthlyActive":0,
                   "monthlyStaticIp":0
                 }
               },
               "appOriginatedSms":{
                 "transitions":{
                   "setup":0,
                   "termination":0,
                   "suspension":0,
                   "reactivation":0
                 },
                 "customer":{
                   "monthlyActive":11,
                   "monthlySuspended":120,
                   "operationSendSms":134,
                   "monthlyVoucherUnits":0
                 }
               },
               "advancedSupervision":{
                 "transitions":{
                   "setup":0,
                   "termination":0,
                   "suspension":0,
                   "reactivation":0
                 },
                 "customer":{
                   "monthlyActive":0,
                   "monthlySuspended":0
                 },
                 "subscription":{
                   "monthlyActive":0,
                   "operationDiagnosisIcmp":0
                 }
               },
               "location":{
                 "transitions":{
                   "setup":0,
                   "termination":0,
                   "suspension":0,
                   "reactivation":0
                 },
                 "customer":{
                   "monthlyActive":0,
                   "monthlySuspended":0
                 },
                 "subscription":{
                   "monthlyActive":0
                 }
               },
               "dca":{
                 "transitions":{
                   "setup":0,
                   "termination":0,
                   "suspension":0,
                   "reactivation":0
                 },
                 "customer":{
                   "monthlyActive":0,
                   "monthlySuspended":0
                 },
                 "subscription":{
                   "monthlyActive":0
                 }
               },
               "dim":{
                 "transitions":{
                   "setup":0,
                   "termination":0,
                   "suspension":0,
                   "reactivation":0
                 },
                 "customer":{
                   "monthlyActive":0,
                   "monthlySuspended":0
                 },
                 "subscription":{
                   "monthlyActive":0
                 }
               },
               "advsupLocLevel":{
                 "customer":{
                   "monthlyLevel_1":0,
                   "monthlyLevel_2":0,
                   "monthlyLevel_3":0,
                   "monthlyLevel_4":0,
                   "monthlyLevel_5":0
                 },
                 "subscription":{
                   "monthlyLevel_1":0,
                   "monthlyLevel_2":0,
                   "monthlyLevel_3":0,
                   "monthlyLevel_4":0,
                   "monthlyLevel_5":0
                 }
               },
               "other":{
                 "simSetup":0,
                 "simTransportation":0,
                 "simActivation":0
               }
             },
             "serviceProviderId":"' . self::PROVIDER_COMMERCIAL_ORG_ID . '",
             "serviceProviderName":"MockServiceProvider",
             "customerId":"' . self::CUSTOMER_ORG_ID . '",
             "customerName":"M2M_CUSTOMER",
             "applicationOriginatedSms":2
           }
     ';
     $array = Zend_Json::decode($supplJson);
     $this->_suppServicesPack = new \Application\Model\SupplServicesModel($array);
     $this->_addUser(self::SERVICE_PROVIDER_ID, Organization\OrgServiceProviderModel::ORG_TYPE);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_spMapper = \Application\Model\Mapper\SupplServicesMapper::getInstance();
     $this->_user = $this->_createAuthUser(array('userName' => 'SimUserTest', 'organizationId' => self::CUSTOMER_ORG_ID));
 }