/**
  * Displays all BounceAccounts
  *
  * @return string The rendered list view
  */
 public function listAction()
 {
     $bounceAccounts = $this->bounceAccountRepository->findAll();
     $this->view->setVariablesToRender(array('total', 'data', 'success', 'flashMessages'));
     $this->view->setConfiguration(array('data' => array('_descendAll' => self::resolveJsonViewConfiguration())));
     $this->addFlashMessage('Loaded BounceAccounts from Server side.', 'BounceAccounts loaded successfully', \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE);
     $this->view->assign('total', $bounceAccounts->count());
     $this->view->assign('data', $bounceAccounts);
     $this->view->assign('success', true);
     $this->flushFlashMessages();
 }
 /**
  * Displays the newsletter used as model for plannification
  *
  * @return string The rendered list view
  */
 public function listPlannedAction()
 {
     $newsletter = $this->newsletterRepository->getLatest($this->pid);
     if (!$newsletter) {
         $newsletter = $this->objectManager->get('Ecodev\\Newsletter\\Domain\\Model\\Newsletter');
         $newsletter->setPid($this->pid);
         $newsletter->setUid(-1);
         // We set a fake uid so ExtJS will see it as a real record
         // Set the first Bounce Account found if any
         $newsletter->setBounceAccount($this->bounceAccountRepository->findFirst());
     }
     // Default planned time is right now
     $newsletter->setPlannedTime(new DateTime());
     $this->view->setVariablesToRender(array('total', 'data', 'success'));
     $this->view->setConfiguration(array('data' => self::resolvePlannedJsonViewConfiguration()));
     $this->view->assign('total', 1);
     $this->view->assign('data', $newsletter);
     $this->view->assign('success', true);
     $this->flushFlashMessages();
 }