Welcome to DigiComp.SettingValidator’s documentation!¶

This Package allows to configure Validators for your Action-Arguments or domain model properties to be set by a new Yaml-File in your Configuration directory.

Lets imagine you have this action-method:

 * @param Order $order
 * @Flow\Validate(type="DigiComp.SettingValidator:Settings", argumentName="$order")
public function createOrder(Order $order) {...}

Then your Validation.yaml can look like this:

    property: price
    validator: NumberRange
      maximum: 20
      minimum: 10
    validator: SuperVendor.SuperPackage:SomeOtherValidator #validates the complete object
    options: []
    property: customer
    validator: DigiComp.SettingValidator:Settings
      name: OrderCustomer

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 object and searches in Validation.yaml for the FQCN.