Config Class
Data class which represents a single config property. Located in the namespace Canteen\Services\Objects.
Item Index
Methods
Methods
add
()
protected
Add a new object
autoDetectType
-
value
Auto detect the value type
Parameters:
-
valueStringThe value to check
Returns:
The value type (boolean, string, integer)
error
-
message
Convenience function for passing an error to the form factory
Parameters:
-
messageStringThe str error to pass
getData
-
name -
value
Save the form data to the form factory
Parameters:
-
nameStringThe name of the variable to save
-
valueMixedThe value of the variable to save
getObject
-
id
Generalized get object by ID
Parameters:
-
idIntThe unique object id
Returns:
The object, or null
onBeforeAdd
-
event
Delete a config variable
Parameters:
-
eventObjectFormEventThe before add event
onBeforeRemove
-
event
Delete a config variable
Parameters:
-
eventObjectFormEventThe before remove event
onBeforeUpdate
-
event
Do some checking before updating
Parameters:
-
eventObjectFormEventThe before update event
parse
-
content -
substitutions
Convenience method for parsing content
Parameters:
-
contentStringThe string to parse
-
substitutionsDictionaryThe 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
remove
()
protected
Generalized remove function
service
-
alias
Get a service by alias
Parameters:
-
aliasStringThe alias
Returns:
The service matching the alias
success
-
message
Convenience function for passing a success message to the form factory
Parameters:
-
messageStringThe str success message to pass
template
-
name -
[substitutions=[]
Convenience method for parsing content
Parameters:
-
nameStringThe name of the template to parse
-
[substitutions=[]Dictionary optionalThe dictionary of tags to replace
Returns:
The parsed string
update
()
protected
Update the object
validate
()
private
Do some initial sanitize
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
access
Int
The settings manager access option
id
Int
The unique config id
parser
Parser
The parser is responsible for rendering templates
profiler
Profiler
The instance of the profiler for debugging performance
type
Sring
Either string, integer, boolean, page, or path
value
Mixed
The value of the config
