-
Notifications
You must be signed in to change notification settings - Fork 4
/
Datasource.cfc
41 lines (32 loc) · 1.55 KB
/
Datasource.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<cfcomponent displayname="Datasource" output="false" hint="I am the Datasource class.">
<cfproperty name="DSN" type="string" default="" />
<cfproperty name="username" type="string" default="" />
<cfproperty name="password" type="string" default="" />
<!--- Pseudo-contructor --->
<cfset variables.instance = {
DSN = '',
username = '',
password = ''
} />
<cffunction name="init" access="public" output="false" returntype="any" hint="I am the constructor method for the Datasource class.">
<cfargument name="DSN" type="string" required="true" default="" hint="I am the name of the datasource." />
<cfargument name="username" type="string" required="true" default="" hint="I am the username of the datasource." />
<cfargument name="password" type="string" required="true" default="" hint="I am the password of the datasource." />
<cfscript>
variables.instance.DSN = ARGUMENTS.DSN;
variables.instance.username = ARGUMENTS.username;
variables.instance.password = ARGUMENTS.password;
</cfscript>
<cfreturn this>
</cffunction>
<!--- getters --->
<cffunction name="getDSN" access="public" output="false" hint="I return the name of the datasource.">
<cfreturn variables.instance.DSN>
</cffunction>
<cffunction name="getUsername" access="public" output="false" hint="I return the name of the datasource.">
<cfreturn variables.instance.username>
</cffunction>
<cffunction name="getPassword" access="public" output="false" hint="I return the name of the datasource.">
<cfreturn variables.instance.password>
</cffunction>
</cfcomponent>