PHP Class OphCoTherapyapplication_Processor

(C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011 (C) OpenEyes Foundation, 2011-2013 This file is part of OpenEyes. OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see .
Author: OpenEyes ([email protected])
Datei anzeigen Open project: openeyes/openeyes Class Usage Examples

Public Methods

Method Description
__construct ( Event $event )
generatePreviewPdf ( CController $controller ) : OETCPDF Generate PDFs in a wrapper for preview purposes.
getApplicationStatus ( ) : string Returns status of applicant: pending, sent, re-opened.
getEyeNameById ( $eye_id ) : string
getLeftSentEmails ( ) : OphCoTherapyapplication_Email[]
getPDFContentForSide ( $controller, $template_data, $side )
getProcessWarnings ( ) : array Get any relevant warnings.
getRightSentEmails ( ) : OphCoTherapyapplication_Email[]
getSiteName ( )
hasEmailRecipients ( )
isEventNonCompliant ( ) : boolean return boolean to indicate whether the given event is non compliant or not.
processEvent ( CController $controller, User $notify_user = null ) : boolean processes the application for the event with id $event_id returns a boolean to indicate whether this was successful or not.

Protected Methods

Method Description
createAndSavePdfForSide ( CController $controller, array $template_data, string $side ) : ProtectedFile | null create the PDF file as a ProtectedFile for the given side.
generateEmailForSide ( CController $controller, array $template_data, string $side ) : string generate the email text for the given side.
getElement ( string $class_name ) : BaseEventTypeElement | null Get an element object by class name.

Private Methods

Method Description
getEmailRecipients ( $service_info, $recipient_type )
getServiceInfo ( )
getSideSpecificTemplateData ( string $side ) : array
getTemplateData ( ) : array
getViewPath ( ) : string
processEventForEye ( CController $controller, array $template_data, integer $eye_id, User $notify_user = null ) : boolean

Method Details

__construct() public method

public __construct ( Event $event )
$event Event Must be an OphCoTherapyapplication event

createAndSavePdfForSide() protected method

create the PDF file as a ProtectedFile for the given side.
protected createAndSavePdfForSide ( CController $controller, array $template_data, string $side ) : ProtectedFile | null
$controller CController
$template_data array
$side string
return ProtectedFile | null

generateEmailForSide() protected method

generate the email text for the given side.
protected generateEmailForSide ( CController $controller, array $template_data, string $side ) : string
$controller CController
$template_data array
$side string
return string

generatePreviewPdf() public method

Note that this is currently only used for non-compliant applications.
public generatePreviewPdf ( CController $controller ) : OETCPDF
$controller CController
return OETCPDF

getApplicationStatus() public method

Returns status of applicant: pending, sent, re-opened.
public getApplicationStatus ( ) : string
return string

getElement() protected method

We could potentially add a caching layer here if performance becomes a problem, but would have to watch out for stale data
protected getElement ( string $class_name ) : BaseEventTypeElement | null
$class_name string
return BaseEventTypeElement | null

getEyeNameById() public method

public getEyeNameById ( $eye_id ) : string
$eye_id
return string

getLeftSentEmails() public method

public getLeftSentEmails ( ) : OphCoTherapyapplication_Email[]
return OphCoTherapyapplication_Email[]

getPDFContentForSide() public method

public getPDFContentForSide ( $controller, $template_data, $side )

getProcessWarnings() public method

Get any relevant warnings.
public getProcessWarnings ( ) : array
return array

getRightSentEmails() public method

public getRightSentEmails ( ) : OphCoTherapyapplication_Email[]
return OphCoTherapyapplication_Email[]

getSiteName() public method

public getSiteName ( )

hasEmailRecipients() public method

public hasEmailRecipients ( )

isEventNonCompliant() public method

return boolean to indicate whether the given event is non compliant or not.
See also: Element_OphCoTherapyapplication_PatientSuitability::isNonCompliant()
public isEventNonCompliant ( ) : boolean
return boolean

processEvent() public method

processes the application for the event with id $event_id returns a boolean to indicate whether this was successful or not.
public processEvent ( CController $controller, User $notify_user = null ) : boolean
$controller CController
$notify_user User
return boolean