No description
Find a file
2021-01-11 17:00:12 +01:00
Classes code style 2020-08-19 13:56:55 +02:00
Configuration/Testing add quotes around strings in YAML files 2018-04-03 17:53:57 +02:00
Migrations/Code remove unused import 2020-08-10 13:47:28 +02:00
Resources/Private/Schema write strings in yaml files in quotes 2020-03-11 10:39:33 +01:00
Tests/Functional update to newest standard 2020-07-22 17:22:46 +02:00
CHANGELOG.md raise required version of neos/flow to 6.3 2020-09-09 10:47:24 +02:00
composer.json optimized composer.json 2021-01-11 17:00:12 +01:00
License.txt Adding License and small readme 2015-04-29 17:50:13 +02:00
README.md update to newest standard 2020-07-22 17:22:46 +02:00

DigiComp.SettingValidator

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

Let's imagine you had this action-method:

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

Then your Validation.yaml could look like this:

Vendor\Package\Domain\Model\Order:
  # validates the complete object
  self:
    'Vendor.Package:SomeOtherValidator': []
  # validates properties of the object
  properties:
    price:
      NumberRange:
        maximum: 20
        minimum: 10
    customer:
      'DigiComp.SettingValidator:Settings':
        name: 'OrderCustomer'

OrderCustomer:
  properties:
    firstName:
      StringLength:
        minimum: 3
        maximum: 20

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.