/**
  * Method to do something before save.
  *
  * @return void
  */
 protected function prepareExecute()
 {
     parent::prepareExecute();
     // Attempt to check-in the current record.
     $data = array('cid' => array($this->recordId), 'quiet' => true);
     $this->fetch($this->prefix, $this->viewList . '.check.checkin', $data);
     // Reset the ID and then treat the request as for Apply.
     $this->data[$this->key] = 0;
     $this->data['checked_out'] = '';
     $this->data['checked_out_time'] = '';
     if (isset($this->data['title'])) {
         $this->data['title'] = \JString::increment($this->data['title']);
     }
     if (isset($this->data['alias'])) {
         $this->data['alias'] = \JString::increment($this->data['alias'], 'dash');
     }
 }
 /**
  * Check credentials and intialize members
  */
 public function beforeAction()
 {
     parent::beforeAction();
     if (!isset($this->_store->applicantID)) {
         //Not authenticated
         $this->addMessage('error', "You are not logged in or your session has expired.  Please log in again");
         $this->redirectApplyPath('applicant/login');
     }
     $this->_applicant = $this->_em->getRepository('\\Jazzee\\Entity\\Applicant')->find($this->_store->applicantID);
     //make sure the url path is the actual application
     if ($this->_application != $this->_applicant->getApplication()) {
         $this->redirectApplyPath('applicant/login');
     }
     foreach ($this->_pages as $applicationPage) {
         $applicationPage->getJazzeePage()->setApplicant($this->_applicant);
     }
     $this->setVar('applicant', $this->_applicant);
 }