Exemple #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;
     }
 }
 protected function _processEditQuery($params)
 {
     $reportQuery = new ReportQuery();
     $reportQuery->populateWithArray($params);
     $reportQuery->persist();
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($this->_generateQueryGridRowData($reportQuery));
 }