Schema
Less than 1 minute
Schema
class Schema extends \Hazaar\Model\Struct implements \Hazaar\Model\CollectsValidationErrorsProperties
validationErrors
protected array $validationErrorsMethods
addValidationError
Adds a validation error for a specific field.
public addValidationError(string $field, PropertyException $e): voidParameters
| Parameter | Type | Description |
|---|---|---|
$field | string | the name of the field with the validation error |
$e | PropertyException | the exception representing the validation error |
getValidationErrors
Retrieves all validation errors for the schema.
public getValidationErrors(): voidvalidate
Validates the schema and checks if there are any validation errors.
public validate(): boolset
Sets the value of a property, adding a validation error if an exception occurs.
public set(string $name, mixed $value): voidParameters
| Parameter | Type | Description |
|---|---|---|
$name | string | the name of the property to set |
$value | mixed | the value to set for the property |
initialise
Struct initializer.
public initialise(mixed $data, mixed $constructorArgs): voidErrors during initialization will throw PropertyException exceptions immediately.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | the data to initialize the model with |
$constructorArgs | mixed |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:23 +0000