private array $eventHooks
private array $propertyRules
private array $objectHooks
private array $propertyNames
private array $userProperties
private array $allowTypes
public __construct({Array})
Parameter | Type | Description |
---|
$data | \stdClass | |
$args | mixed | |
public __destruct({Array})
Parameter | Type | Description |
---|
$propertyName | string | |
Parameter | Type | Description |
---|
$propertyName | string | |
$propertyValue | mixed | |
Checks if a property is set.
Parameter | Type | Description |
---|
$propertyName | string | the name of the property to check |
Unsets a specific property of the model.
This magic method is called when an unset operation is performed on an inaccessible property of the model. It allows you to unset a specific property by its name.
Parameter | Type | Description |
---|
$propertyName | string | the name of the property to unset |
Applies the minimum value rule to a property.
private __propertyRule__min({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | int | the value of the property |
$minValue | int | the minimum allowed value |
Applies a maximum value rule to a property.
private __propertyRule__max({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | int | the value of the property |
$maxValue | int | the maximum allowed value |
Applies a range validation rule to a property value.
private __propertyRule__range({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | int | the value of the property |
$minValue | int | the minimum allowed value |
$maxValue | int | the maximum allowed value |
Validates if a property is required and throws an exception if it is empty.
private __propertyRule__required({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property being validated |
$propertyValue | mixed | the value of the property being validated |
Validates the minimum length of a property value.
private __propertyRule__minlength({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property being validated |
$propertyValue | string | the value of the property being validated |
$minLength | int | the minimum length required for the property value |
Validates the maximum length of a property value.
private __propertyRule__maxlength({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property being validated |
$propertyValue | string | the value of the property being validated |
$maxLength | int | the maximum length allowed for the property value |
Pads a string property value with spaces to a specified length.
private __propertyRule__pad({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | string | the value of the property |
$padLength | int | the desired length of the padded string |
Applies a filter to a property value based on the specified filter type.
private __propertyRule__filter({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | string | the value of the property |
$filterType | int | the filter type to apply |
Checks if the given property value contains the specified value.
private __propertyRule__contains({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property being validated |
$propertyValue | array | the value of the property being validated |
$contains | mixed | the value to check if it is contained in the property value |
Formats the given property value according to the specified format.
private __propertyRule__format({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | string | the value of the property |
$format | string | the format string to apply to the property value |
Applies a custom property rule to the given property.
private __propertyRule__custom({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | mixed | the value of the property |
$callback | callable | the callback function to apply the custom rule |
Trims the specified character from the given property value.
private __propertyRule__trim({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | mixed | the value of the property |
$char | string | the character to be trimmed (default is ' ') |
public __serialize({Array})
public __unserialize({Array})
Parameter | Type | Description |
---|
$data | array | |
Magic method called when reading inaccessible properties.
Parameter | Type | Description |
---|
$propertyName | string | The name of the property being accessed |
Sets the value of a property dynamically.
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | mixed | the value to set for the property |
(re)Populates the model with data from an array or object.
This method is used to populate the model with data from an array or object. If the object already has data, it will be overwritten by the new data. This includes any setting properties to null if they are not present in the new data.
Parameter | Type | Description |
---|
$data | object | the data to populate the model with |
Extends the model with additional data.
Parameter | Type | Description |
---|
$data | object | the data to extend the model with |
Converts the object to an array representation.
Parameter | Type | Description |
---|
$ignoreNullPropertyValues | bool | |
Returns the object data as a JSON serializable array.
public jsonSerialize({Array})
Converts the model object to a JSON string.
public fromJSONString({Array})
Parameter | Type | Description |
---|
$json | string | |
Parameter | Type | Description |
---|
$propertyName | string | |
public defineProperty({Array})
Parameter | Type | Description |
---|
$propertyType | string | |
$propertyName | string | |
$propertyValue | mixed | |
Defines an event hook for the model.
public defineEventHook({Array})
Parameter | Type | Description |
---|
$hookName | string | the name of the hook |
$args | mixed | |
Defines a rule for a property in the model.
public defineRule({Array})
Parameter | Type | Description |
---|
$rule | string | the name of the rule |
$propertyNames | string | the name of one or more properties |
$args | mixed | |
protected construct({Array})
Parameter | Type | Description |
---|
$data | array | |
protected constructed({Array})
Parameter | Type | Description |
---|
$data | array | |
private setUserProperty({Array})
Parameter | Type | Description |
---|
$propertyName | string | |
$propertyValue | mixed | |
Converts the data type of a property value based on its reflection.
private convertPropertyValueDataType({Array})
Parameter | Type | Description |
---|
$reflectionProperty | \ReflectionProperty | the reflection of the property |
$propertyValue | mixed | |
private convertValueDataType({Array})
Parameter | Type | Description |
---|
$propertyType | string | |
$propertyValue | mixed | |
Executes the property rules for a given property.
private execPropertyRules({Array})
Parameter | Type | Description |
---|
$propertyName | string | the name of the property |
$propertyValue | mixed | |
$rules | array | the array of rules to be applied |
Generated by Hazaar API Doc Generator