/** * PDF a full single applicant * @param \Jazzee\Entity\Applicant $applicant * @return string the PDF buffer suitable for display */ public function pdf(\Jazzee\Entity\Applicant $applicant) { $elements = array('applicant' => array(), 'pages' => array()); $elements['applicant']['firstName'] = $applicant->getFirstName(); $elements['applicant']['lastName'] = $applicant->getLastName(); $elements['applicant']['middleName'] = $applicant->getMiddleName(); $elements['applicant']['fullName'] = $applicant->getFullName(); $elements['applicant']['suffix'] = $applicant->getSuffix(); $elements['applicant']['email'] = $applicant->getEmail(); $elements['applicant']['id'] = $applicant->getId(); $elements['applicant']['externalid'] = $applicant->getExternalId(); if ($applicant->isLocked()) { switch ($applicant->getDecision()->status()) { case 'finalDeny': $status = 'Denied'; break; case 'finalAdmit': $status = 'Admited'; break; case 'acceptOffer': $status = 'Accepted'; break; case 'declineOffer': $status = 'Declined'; break; default: $status = 'No Decision'; } } else { $status = 'Not Locked'; } $elements['applicant']['status'] = $status; foreach ($applicant->getApplication()->getApplicationPages() as $applicationPage) { if ($applicationPage->getJazzeePage() instanceof \Jazzee\Interfaces\PdfPage) { $applicationPage->getJazzeePage()->setApplicant($applicant); $applicationPage->getJazzeePage()->setController($this->_controller); $elements['pages'][$applicationPage->getPage()->getId()] = $applicationPage->getJazzeePage()->getPdfTemplateValues(); } } return $this->generatePDF($elements); }