/**
  * {@inheritdoc}
  */
 public function handle(MassActionHandlerArgs $args)
 {
     $massAction = $args->getMassAction();
     $entityName = $this->actionRepository->getEntityName($args->getDatagrid());
     if (!$this->isMassActionEnabled($entityName)) {
         return $this->getResponse($massAction, 0, 'Action not configured or not allowed');
     }
     $massAction->getOptions()->offsetSet('entityName', $entityName);
     $entitiesCount = $this->actionRepository->batchUpdate($massAction, $args->getResults(), $args->getData());
     return $this->getResponse($massAction, $entitiesCount);
 }