Ejemplo n.º 1
0
 function populate()
 {
     parent::populate();
     $db = Zend_Registry::get('dbAdapter');
     $repSelect = $db->select()->from('reportQueries')->joinUsing('reportsToQueries', "reportQueryId")->where('reportsToQueries.reportId =' . (int) $this->id);
     foreach ($db->query($repSelect)->fetchAll() as $row) {
         $rq = new ReportQuery();
         $rq->populateWithArray($row);
         $this->reportQueries[] = $rq;
     }
     $repSelect = $db->select()->from('reportTemplates')->joinUsing('reportsToTemplates', "reportTemplateId")->where('reportsToTemplates.reportId =' . (int) $this->id);
     foreach ($db->query($repSelect)->fetchAll() as $row) {
         $rt = new ReportTemplate();
         $rt->populateWithArray($row);
         $this->reportTemplates[] = $rt;
     }
 }