No description
Find a file
Daniel Siepmann 3c53a4de5b
BUGFIX: Add missing argumentName
* As this is not mandantory.
2017-03-06 11:38:43 +01:00
Classes/DigiComp/SettingValidator just some documentation 2015-04-29 17:52:27 +02:00
Documentation BUGFIX: Add missing argumentName 2017-03-06 11:38:43 +01:00
.gitignore Initial commit 2014-04-18 14:20:28 +02:00
composer.json [TASK] Apply migration TYPO3.Fluid-20150214130800 2015-07-21 16:20:08 +02:00
License.txt Adding License and small readme 2015-04-29 17:50:13 +02:00
README.md BUGFIX: Add missing argumentName 2017-03-06 11:38:43 +01:00

DigiComp.SettingValidator

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 had this action-method:

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

Then your Validation.yaml could look like this:

SuperVendor\SuperPackage\Domain\Model\Order:
  -
	property: price 
	validator: NumberRange
	options:
	  maximum: 20
	  minimum: 10
  -
    validator: SuperVendor.SuperPackage:SomeOtherValidator #validates the complete object
    options: []
  -
    property: customer
    validator: DigiComp.SettingValidator:Settings
    options:
      name: OrderCustomer
      
OrderCustomer:
  -
    property: firstName
    validator: StringLength
    options:
      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.