Example #1
0
 /**
  * Создание link для прохождения теста
  * @return void
  */
 public function newlinkAction()
 {
     if ($this->_authorize('test', 'edit')) {
         $applicantId = (int) $this->getRequest()->getParam('applicantId');
         $testId = (int) $this->getRequest()->getParam('testId');
         $objApplicantTests = new ApplicantTests();
         //$objVacanciesTest = new VacanciesTest();
         if (!$objApplicantTests->existLink($applicantId, $testId)) {
             $newRow = $objApplicantTests->createRow();
             $newRow->applicant_id = $applicantId;
             $newRow->test_id = $testId;
             $newRow->link = md5(time());
             $newRow->save();
         }
         $this->_helper->redirector('index', 'applicant');
     }
 }