public function getAppointmentsForEpisode($episode)
    {
        $select = $this->_getAppointmentSelect();

        if ($episode instanceof EpisodeOfCare) {
            $episodeId = $episode->getId();
        } else {
            $episodeId = $episode;
        }
        $select->where('gap_id_episode = ?', $episodeId);

        // \MUtil_Echo::track($select->__toString());
        $rows = $this->db->fetchAll($select);

        if (! $rows) {
            return array();
        }

        $results = array();
        foreach ($rows as $row) {
            $results[$row['gap_id_appointment']] = $this->getAppointment($row);
        }
        return $results;
    }
public function getAppointmentsForEpisode($episode)
    {
        $select = $this->_getAppointmentSelect();

        if ($episode instanceof EpisodeOfCare) {
            $episodeId = $episode->getId();
        } else {
            $episodeId = $episode;
        }
        $select->where('gap_id_episode = ?', $episodeId);

        // \MUtil_Echo::track($select->__toString());
        $rows = $this->db->fetchAll($select);

        if (! $rows) {
            return array();
        }

        $results = array();
        foreach ($rows as $row) {
            $results[$row['gap_id_appointment']] = $this->getAppointment($row);
        }
        return $results;
    }
public function getAppointmentsForEpisode ( $ episode ) { $ select = $ this -> _getAppointmentSelect ( ) ; if ( $ episode instanceof EpisodeOfCare ) { $ episodeId = $ episode -> getId ( ) ; } else { $ episodeId = $ episode ; } $ select -> where ( 'gap_id_episode = ?' , $ episodeId ) ; // \MUtil_Echo::track($select->__toString()); $ rows = $ this -> db -> fetchAll ( $ select ) ; if ( ! $ rows ) { return array ( ) ; } $ results = array ( ) ; foreach ( $ rows as $ row ) { $ results [ $ row [ 'gap_id_appointment' ] ] = $ this -> getAppointment ( $ row ) ; } return $ results ; }
Get all appointments for an episode

@param int|Episode $episode Episode Id or object
@return array appointmentId => appointment object
Get all appointments for an episode