OEModule\OphCoCvi\components\OphCoCvi_Manager::canIssueCvi PHP Method

canIssueCvi() public method

public canIssueCvi ( Event $event ) : boolean
$event Event
return boolean
    public function canIssueCvi(\Event $event)
    {
        if ($info = $this->getEventInfoElementForEvent($event)) {
            if (!$info->is_draft) {
                return false;
            }
        } else {
            return false;
        }
        if ($clinical = $this->getClinicalElementForEvent($event)) {
            $clinical->setScenario('finalise');
            if (!$clinical->validate()) {
                return false;
            }
            if (!$clinical->consultant_signature_file_id) {
                return false;
            }
        } else {
            return false;
        }
        if ($clerical = $this->getClericalElementForEvent($event)) {
            $clerical->setScenario('finalise');
            if (!$clerical->validate()) {
                return false;
            }
        } else {
            return false;
        }
        if ($demographics = $this->getDemographicsElementForEvent($event)) {
            $demographics->setScenario('finalise');
            if (!$demographics->validate()) {
                return false;
            }
        } else {
            return false;
        }
        if ($signature = $this->getConsentSignatureElementForEvent($event)) {
            if (!$signature->checkSignature()) {
                return false;
            }
        } else {
            return false;
        }
        return true;
    }