Example #1
0
 /**
  * Construcutor takes the application we want to display
  * @param \Jazzee\Entity\Application $application
  */
 public function __construct(\Jazzee\Entity\Application $application)
 {
     $applicantElements = array('firstName' => 'First Name', 'lastName' => 'Last Name', 'email' => 'Email', 'createdAt' => 'Created At', 'updatedAt' => 'Updated At', 'lastLogin' => 'Last Login', 'percentComplete' => 'Progress', 'isLocked' => 'Locked', 'lockedAt' => 'Last Locked', 'hasPaid' => 'Paid', 'externalId' => 'External ID', 'attachments' => 'Attachments', 'status_declined' => 'Declined', 'status_admitted' => 'Admitted', 'status_denied' => 'Denied', 'status_accepted' => 'Accepted', 'status_nominate_admit' => 'Nominate Admit', 'status_nominate_deny' => 'Nominate Deny');
     foreach ($application->getApplicants() as $applicant) {
         foreach ($applicant->getTags() as $tag) {
             $applicantElements[$tag->getId()] = $tag->getTitle();
         }
     }
     $weight = 0;
     foreach ($applicantElements as $name => $title) {
         $this->_elements[] = new \Jazzee\Display\Element('applicant', $title, $weight++, $name, null);
     }
     $pages = array();
     foreach ($application->getApplicationPages() as $applicationPage) {
         if (is_subclass_of($applicationPage->getPage()->getType()->getClass(), 'Jazzee\\Interfaces\\DataPage')) {
             foreach ($applicationPage->getJazzeePage()->listDisplayElements() as $displayElement) {
                 $this->_elements[] = $displayElement;
                 if ($displayElement->getType() == 'page') {
                     $this->_pageIds[] = $displayElement->getPageId();
                 } else {
                     if ($displayElement->getType() == 'element') {
                         $this->_elementIds[] = $displayElement->getName();
                         $this->_pageIds[] = $application->getElementById($displayElement->getName())->getPage()->getId();
                     }
                 }
             }
         }
     }
 }