replaces tabs with spaces
This commit is contained in:
parent
87544c3976
commit
e8c94b15a1
1 changed files with 29 additions and 29 deletions
58
README.md
58
README.md
|
@ -7,40 +7,40 @@ Yaml-File in your Configuration directory.
|
||||||
|
|
||||||
Lets imagine you had this action-method:
|
Lets imagine you had this action-method:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Order $order
|
* @param Order $order
|
||||||
* @Flow\Validate(type="DigiComp.SettingValidator:Settings")
|
* @Flow\Validate(type="DigiComp.SettingValidator:Settings")
|
||||||
*/
|
*/
|
||||||
public function createOrder($order) {...}
|
public function createOrder($order) {...}
|
||||||
|
|
||||||
Then your Validation.yaml could look like this:
|
Then your Validation.yaml could look like this:
|
||||||
|
|
||||||
SuperVendor\SuperPackage\Domain\Model\Order:
|
SuperVendor\SuperPackage\Domain\Model\Order:
|
||||||
-
|
-
|
||||||
property: price
|
property: price
|
||||||
validator: NumberRange
|
validator: NumberRange
|
||||||
options:
|
options:
|
||||||
maximum: 20
|
maximum: 20
|
||||||
minimum: 10
|
minimum: 10
|
||||||
-
|
-
|
||||||
validator: SuperVendor.SuperPackage:SomeOtherValidator #validates the complete object
|
validator: SuperVendor.SuperPackage:SomeOtherValidator #validates the complete object
|
||||||
options: []
|
options: []
|
||||||
-
|
-
|
||||||
property: customer
|
property: customer
|
||||||
validator: DigiComp.SettingValidator:Settings
|
validator: DigiComp.SettingValidator:Settings
|
||||||
options:
|
options:
|
||||||
name: OrderCustomer
|
name: OrderCustomer
|
||||||
|
|
||||||
OrderCustomer:
|
OrderCustomer:
|
||||||
-
|
-
|
||||||
property: firstName
|
property: firstName
|
||||||
validator: StringLength
|
validator: StringLength
|
||||||
options:
|
options:
|
||||||
minimum: 3
|
minimum: 3
|
||||||
maximum: 20
|
maximum: 20
|
||||||
|
|
||||||
|
|
||||||
As you see: Nesting is possible ;) That way you can easily construct flexible structures.
|
As you see: Nesting is possible ;) That way you can easily construct flexible structures.
|
||||||
|
|
||||||
The SettingsValidator has an optional option: "name" - If you don't give one, it assumes your validation value is an
|
The SettingsValidator has an optional option: "name" - If you don't give one, it assumes your validation value is an
|
||||||
object and searches in Validation.yaml for the FQCN.
|
object and searches in Validation.yaml for the FQCN.
|
||||||
|
|
Loading…
Reference in a new issue