public function populateObject($rsItem) { $seq = $rsItem["wqdfiledatachannelseq"]; $dataSeq = $rsItem["wqdfiledataseq"]; $channelNo = $rsItem["wqdfiledatachannelnumber"]; $channelName = $rsItem["wqdfiledatachannelname"]; $channelValue = $rsItem["wqdfiledatachannelvalue"]; $channelStatus = $rsItem["wqdfiledatachannelstatus"]; $channel = new WQDChannel(); $channel->setSeq($seq); $channel->setFileDataSeq($dataSeq); $channel->setChannelNumber($channelNo); $channel->setChannelName($channelName); $channel->setChannelValue($channelValue); $channel->setChannelStatus($channelStatus); return $channel; }
$wqdChannel1->setChannelNumber("1231"); $wqdChannel1->setChannelStatus(11); $wqdChannel1->setChannelValue(1.21); $wqdChannelArr[0] = $wqdChannel; $wqdChannelArr[1] = $wqdChannel1; //<---------------------> $wqdChannelArr1 = array(); $wqdChannel2 = new WQDChannel(); $wqdChannel2->setChannelName("testChannelName2"); $wqdChannel2->setChannelNumber("1232"); $wqdChannel2->setChannelStatus(12); $wqdChannel2->setChannelValue(1.22); $wqdChannel3 = new WQDChannel(); $wqdChannel3->setChannelName("testChannelName3"); $wqdChannel3->setChannelNumber("1233"); $wqdChannel3->setChannelStatus(13); $wqdChannel3->setChannelValue(1.23); $wqdChannelArr1[0] = $wqdChannel2; $wqdChannelArr1[1] = $wqdChannel3; //<------------------------> $wqdData = new WQDData(); $wqdDataarr = array(); $wqdData->setChannels($wqdChannelArr); $wqdData->setChecksum("testCheckSum"); $wqdData->setDataDate($date); $wqdData->setReportNo(1); $wqdData->setTotalChannels(count($wqdChannelArr)); $wqdData1 = new WQDData(); $wqdData1->setChannels($wqdChannelArr1); $wqdData1->setChecksum("testCheckSum1"); $wqdData1->setDataDate($date);