Model
This class will handle the data’s sanitize and validation, it doesn’t do the saving.
Description #
Class Model
Source #
Methods #
- __construct — Model constructor.
- __set — Set value of an object property.
- get_error — Retrieve the errors relate to a single property.
- get_errors — Retrieve all validation errors;
- offsetExists — Returns whether there is an element at the specified offset.
- offsetGet — Returns the element at the specified offset.
- offsetSet — Sets the element at the specified offset.
- offsetUnset — Sets the element value at the specified offset to null.
- parse_annotation_rule — Get the validation rule
- parse_annotation_sanitize — Get the sanitize function
- parse_annotations — Parse the annotations of the class, and cache it. The list should be - type: for casting - sanitize_*: the list of sanitize_ functions, which should be run on this property - rule: the rule that we use for validation
- parse_annotations_var — Get the variable type
- to_array — In model, we going to parse the annotations if any.
- validate — The validator engine.