protected function getDisplayFields(SubmissionEntity $submission)
 {
     $detail = $submission->getDetail();
     $data = $this->extract($detail);
     $displayFields = array();
     if ($data) {
         for ($i = 1; $i < 4; $i++) {
             if (isset($data["Question{$i}"])) {
                 $displayField = new DisplayField();
                 $DisplayPrompt = $data["Question{$i}"];
                 $DisplayValue = isset($data["Answer{$i}"]) ? $data["Answer{$i}"] : "";
                 $displayField->setDisplayPrompt($DisplayPrompt);
                 $displayField->setDisplayValue($DisplayValue);
                 $displayFields[] = $displayField;
             }
         }
     }
     return $displayFields;
 }
 protected function getDisplayFields(Lead $lead)
 {
     $leadAttributeValues = $lead->findAttributes('Question');
     $displayFields = array();
     if ($leadAttributeValues->count() > 0) {
         foreach ($leadAttributeValues as $attribute) {
             $DisplayPrompt = $attribute->getAttribute()->getAttributeDesc();
             switch (strtolower($DisplayPrompt)) {
                 case 'notes':
                     break;
                 default:
                     $displayField = new DisplayField();
                     $DisplayValue = $attribute->getValue();
                     $displayField->setDisplayPrompt($DisplayPrompt);
                     $displayField->setDisplayValue($DisplayValue);
                     $displayFields[] = $displayField;
                     break;
             }
         }
     }
     return $displayFields;
 }