/** * @group EricssonInt */ public function testAddCustomer() { $this->_suppServicesPack->save(); $data = $this->_spMapper->publish($this->_suppServicesPack->getId()); $this->assertNotNull($data); $this->assertTrue($data); $data = $this->_spMapper->addCustomer($this->_suppServicesPack->getId(), Organization\OrgCustomerModel::ORG_TYPE . '-' . self::CUSTOMER_ID); $this->assertNotNull($data); $this->assertTrue($data); }
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; }
/** * @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; }
public function testRemoveCustomer() { $data = $this->_spMapper->removeCustomer(1, 1); $this->assertNotNull($data); $this->assertTrue($data); }