Element_OphTrOperationbooking_Operation::getLetterContact PHP Méthode

getLetterContact() public méthode

public getLetterContact ( )
    public function getLetterContact()
    {
        $site_id = $this->booking->theatre->site_id;
        $subspecialty_id = $this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty_id;
        $theatre_id = $this->booking->session->theatre_id;
        $firm_id = $this->booking->session->firm_id;
        $is_child = $this->getPatient()->isChild($this->booking->session->date);
        $criteria = new CDbCriteria();
        $criteria->addCondition('parent_rule_id is null');
        $criteria->order = 'rule_order asc';
        foreach (OphTrOperationbooking_Letter_Contact_Rule::model()->findAll($criteria) as $rule) {
            if ($rule->applies($site_id, $subspecialty_id, $theatre_id, $firm_id, $is_child)) {
                return $rule->parse($site_id, $subspecialty_id, $theatre_id, $firm_id, $is_child);
            }
        }
        return false;
    }