protected function _mapEnumValue(\DrSlump\Protobuf\Field $descriptor, \App_ListFilter_Interface $filter, \App_ListFilter $filterList)
 {
     if ($filter->getFieldName() == StockFilterFields::LIFE_CYCLE_STATUS) {
         return StockMapper::getInstance()->mapInitialLifeCycleStatusToEricsson($filter->getValue());
     }
     return parent::_mapEnumValue($descriptor, $filter, $filterList);
 }
 public function deleteAll(\App_ListFilter $filterList = NULL)
 {
     $filters = array();
     if ($filterList !== null) {
         $filters['filterList'] = $filterList;
     }
     $mapper = StockMapper::getInstance();
     try {
         $result = $mapper->deleteAll($filters);
     } catch (EricssonException $e) {
         if (!($result = $e->getErrorMessages())) {
             throw $e;
         }
     }
     \App::audit('Deleting all sims from handler ' . $filterList->getCursor(), null);
     $watcher = $mapper->constructWatcherToTransaction();
     $watcher->params->action = 'stockDelete';
     $watcher->params->count = $filterList ? $filterList->getOldCount() : null;
     $txId = uniqid('stockdelete');
     $watcher->entityIds = array($txId);
     WatcherService::getInstance()->create($watcher);
     $event = $mapper->constructEventToTransaction();
     $event->entityId = $txId;
     $eventData = array('hasFailures' => false, 'message' => array());
     if ($result !== true && !empty($result)) {
         $eventData['hasFailures'] = true;
         $eventData['message']['failed'] = $result;
     }
     $event->eventData = $eventData;
     WatcherService::getInstance()->publishEvent($event);
     return $watcher;
 }
 public function testUndelegateSims()
 {
     $sims = array('234234', '23411');
     $response = $this->stockMapper->undelegateSims($sims);
     $this->assertNotNull($response);
 }