CataractComplicationsReport::queryData PHP Method

queryData() protected method

protected queryData ( $surgeon, $dateFrom, $dateTo ) : array | CDbDataReader
$surgeon
$dateFrom
$dateTo
return array | CDbDataReader
    protected function queryData($surgeon, $dateFrom, $dateTo)
    {
        $this->command->reset();
        $this->command->select('COUNT(cataract_id) as complication_count, ophtroperationnote_cataract_complications.name')->from('ophtroperationnote_cataract_complication')->join('et_ophtroperationnote_cataract', 'ophtroperationnote_cataract_complication.cataract_id = et_ophtroperationnote_cataract.id')->join('event', 'et_ophtroperationnote_cataract.event_id = event.id')->join('et_ophtroperationnote_surgeon', 'et_ophtroperationnote_surgeon.event_id = event.id')->join('ophtroperationnote_cataract_complications', 'ophtroperationnote_cataract_complication.complication_id = ophtroperationnote_cataract_complications.id')->where('surgeon_id = :surgeon', array('surgeon' => $surgeon))->andWhere('ophtroperationnote_cataract_complications.name <> "None"')->andWhere('event.deleted=0')->group('complication_id');
        if ($dateFrom) {
            $this->command->andWhere('event.event_date >= :dateFrom', array('dateFrom' => $dateFrom));
        }
        if ($dateTo) {
            $this->command->andWhere('event.event_date <= :dateTo', array('dateTo' => $dateTo));
        }
        return $this->command->queryAll();
    }