/** * Get the field value from an appointment object * * @param \Gems_Agenda_Appointment $appointment * @param string $field * @return mixed */ public function getAppointmentFieldVale(\Gems_Agenda_Appointment $appointment, $field) { switch ($field) { case 'gap_id_organization': return $appointment->getOrganizationId(); case 'gap_source': return $appointment->getSource(); case 'gap_id_attended_by': return $appointment->getAttendedById(); case 'gap_id_referred_by': return $appointment->getReferredById(); case 'gap_id_activity': return $appointment->getActivityId(); case 'gap_id_procedure': return $appointment->getProcedureId(); case 'gap_id_location': return $appointment->getLocationId(); case 'gap_subject': return $appointment->getSubject(); } }
/** * Check a filter for a match * * @param \Gems\Agenda\Gems_Agenda_Appointment $appointment * @return boolean */ public function matchAppointment(\Gems_Agenda_Appointment $appointment) { $regex = '/' . str_replace(array('%', '_'), array('.*', '.{1,1}'), $this->_data['gaf_filter_text1']) . '/i'; return (bool) preg_match($regex, $appointment->getSubject()); }
/** * Check a filter for a match * * @param \Gems\Agenda\Gems_Agenda_Appointment $appointment * @return boolean */ public function matchAppointment(\Gems_Agenda_Appointment $appointment) { return \MUtil_String::contains($appointment->getSubject(), $this->_data['gaf_filter_text1']); }