Class ObjectValidator
Object validator
- Phramework\Validate\BaseValidator
- Phramework\Validate\ObjectValidator
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 0.0.0
See:
http://json-schema.org/latest/json-schema-validation.html#anchor53 5.4. Validation keywords for objects
Todo: Implement patternProperties
Todo: Implement additionalProperties "additionalProperties": { "type": "string" }
Todo: Implement dependencies
Todo: Can it have default?
Located at ObjectValidator.php
Methods summary
public
|
#
__construct( object $properties = [], string[] $required = [], object|boolean|null $additionalProperties = null, integer $minProperties = 0, integer $maxProperties = null )
|
public
|
|
public
object
|
#
parse( array|object $value )
This method use this validator to parse data from $value argument and return a clean object |
public
|
|
public
|
#
addProperty(
Add a property to this object validator |
Methods inherited from Phramework\Validate\BaseValidator
__get()
,
__set()
,
createFromArray()
,
createFromJSON()
,
createFromObject()
,
createFromObjectForAdditional()
,
getType()
,
getTypeAttributes()
,
parseStatic()
,
registerValidator()
,
setDefault()
,
setDescription()
,
setEnum()
,
setTitle()
,
toArray()
,
toJSON()
,
toObject()
,
validateCommon()
,
validateEnum()
Properties summary
protected static
string
|
$type
Overwrite base class type |
#
'object'
|
protected static
string[]
|
$typeAttributes
Validator's attributes Can be overwritten |
#
[
'minProperties',
'maxProperties',
'required',
'properties',
'additionalProperties'
]
|
Properties inherited from Phramework\Validate\BaseValidator
Magic properties
public
integer
|
$minProperties
Minimum number of properties |
public
integer|null
|
$maxProperties
Minimum number of properties |
public
object
|
$properties
Properties |
public
object|boolean|null
|
$additionalProperties
|