TimeService Class
Service for getting the time off the server. Located in the namespace Canteen\Services.
Item Index
Methods
Methods
bindObject
-
data
-
dataClass
-
[prepends=null]
-
[useFirstRow=true]
Bind an associate array to a data object
Parameters:
-
data
ArrayThe data to bind
-
dataClass
StringThe name of the data class (string to bind)
-
[prepends=null]
Array optionalThe array of maps to prepend to the variables used for prepending a path or directory to a file/path/url
-
[useFirstRow=true]
Boolean optionalIf to just return the row in a return, only getting one item from a mysql array call
Returns:
The typed data object
bindObjects
-
data
-
dataClass
-
[prepends=null]
Same as bindObject but done on a whole collection
Parameters:
Returns:
The data object
gateway
-
uri
-
method
-
[privilege=Privilege::ANONYMOUS]
Add for use on the Gateway, these methods can be
called from javascript. For an example see the
TimeService
class.
Parameters:
Returns:
Return the instance of this for chaining
getCaller
-
[ignore=1]
Get the method/function name of the caller function
Parameters:
-
[ignore=1]
Int optionalThe depth of the call, default is the immediate function before this one is called
getServerTime
()
Int
Get the local server time when a more reliable time is needed than the client time
Returns:
The number of UNIX seconds since Jan. 1, 1970
getStack
-
[limit=0]
-
[ignore=1]
Get the method/function name of the caller function
Parameters:
-
[limit=0]
Int optionalThe number of stack items to return, default is all
-
[ignore=1]
Int optionalThe number of stack levesl to ignore, default is the immediate function before this one is called.
parse
-
content
-
substitutions
Convenience method for parsing content
Parameters:
-
content
StringThe string to parse
-
substitutions
DictionaryThe dictionary of tags to replace
Returns:
The parsed string
privilege
-
[required=Privilege::GUEST]
You can run to make sure a process requires a particular privilege
Parameters:
-
[required=Privilege::GUEST]
Int optionalThe privilege level required, default is anonymous
service
-
alias
Get a service by alias
Parameters:
-
alias
StringThe alias
Returns:
The service matching the alias
template
-
name
-
[substitutions=[]
Convenience method for parsing content
Parameters:
-
name
StringThe name of the template to parse
-
[substitutions=[]
Dictionary optionalThe dictionary of tags to replace
Returns:
The parsed string
valueSet
-
A
-
[validationType=null]
Get a set of ids
Parameters:
Returns:
The MySQL formatted set of IDs
verify
-
data
-
[type=null]
-
[suppressErrors=false]
Sanitize input data using the validation types above
Parameters:
Returns:
If we don't verify and suppress errors, returns false, else returns the data
Properties
db
Database
Convenience getter for the database connection
parser
Parser
The parser is responsible for rendering templates
profiler
Profiler
The instance of the profiler for debugging performance