PageForm Class
Update or add a user. Located in the namespace Canteen\Forms.
Item Index
Methods
Methods
add
()
protected
Add a new object
error
-
message
Convenience function for passing an error to the form factory
Parameters:
-
message
StringThe str error to pass
getData
-
name
-
value
Save the form data to the form factory
Parameters:
-
name
StringThe name of the variable to save
-
value
MixedThe value of the variable to save
getObject
-
id
Generalized get object by ID
Parameters:
-
id
IntThe unique object id
Returns:
The object, or null
onAdded
-
event
Handler write the content file after we added
Parameters:
-
event
ObjectFormEventThe added event
onBeforeRemove
-
event
Event handler before a page is removed
Parameters:
-
event
ObjectFormEventThe before remove event
onBeforeUpdate
-
event
Handler to do some extra privilege checking before we update
Parameters:
-
event
ObjectFormEventThe beforeUpdate event
onRemoved
-
event
Event handler after a page is removed
Parameters:
-
event
ObjectFormEventThe removed event
onValidate
-
event
Handler to do some validation before an add or update
Parameters:
-
event
ObjectFormEventThe beforeAdd or beforeUpdate event
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
remove
()
protected
Generalized remove function
service
-
alias
Get a service by alias
Parameters:
-
alias
StringThe alias
Returns:
The service matching the alias
success
-
message
Convenience function for passing a success message to the form factory
Parameters:
-
message
StringThe str success message to pass
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
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
parser
Parser
The parser is responsible for rendering templates
profiler
Profiler
The instance of the profiler for debugging performance