Example #1
0
 public function fromData($data, $program)
 {
     $this->id = $data->Id;
     $this->year = $data->Year__c;
     $this->Account__c = $data->Account__c;
     $this->Contact__c = $data->Contact__c;
     $this->Top_Company__c = $data->Top_Company__c;
     $this->Purchase_Order_Number__c = $data->Purchase_Order_Number__c;
     $this->Payment_Method__c = $data->Payment_Method__c;
     $this->Is_Final__c = $data->Is_Final__c;
     $this->Information_Only__c = $data->Information_Only__c;
     $this->Commments__c = $data->Comments__c;
     foreach ($data->Entry_Response__cs as $resp) {
         $question = $program->getQuestion($resp->Annual_Metric__c);
         $r = new Response();
         $r->setQuestion($question);
         $r->setResponse($resp);
         $this->responses[$question->seq] = $r;
     }
     ksort($this->responses);
 }