Skipper - The ORM Designer Blog
  • Skipper - The ORM Designer
  • VsBuilds - Parallel building
  • Pulpo - Free Skipper CLI

Support of CakePHP validators in ORM Designer

Today we finished beta support of CakePHP validators in ORM Designer. Thanks to Stefano Manfredini for giving us the idea and testing this new feature. You will find this new feature in upcoming ORM Designer 1.4.0 version build 417 and later.

Screenshot of testing model with entered validators:

Detailed screenshot to all supported validators in ORM Designer:

How to use it

If you want to add a validator to any field in your model, follow next instructions:

  1. Select the field where you want to define new data validation.
  2. In ORM Property window click on Validator item ->  ”Add Item”.
  3. After clicking on “Add Item”, the window with all supported validators appear. Choose the required validator and press OK.
  4. After selecting validator from the list, you can add some additional parameters.  You can do this by selecting  added validator and entering value to the correspond property.

After you enter all required validators, you can “Export” them to base class.

And it’s done. No more complicated and confused array definitions, simple design it in ORM Designer ;-)

List of currently supported validators include their parameters:

  • alphaNumeric
  • between
    • minimum
    • maximum
  • blank
  • boolean
  • cc
    • type
    • deep
    • regex
  • comparison
    • operator
    • value
  • date
    • format
  • decimal
    • decimal
  • email
    • validate-host
  • equalTo
    • value
  • extension
    • value
  • ip
  • isUnique
  • minLength
    • value
  • maxLength
    • value
  • money
    • position
  • multiple
    • in
    • min
    • max
  • inList
    • values
  • numeric
  • notEmpty
  • phone
    • reg-ex
    • country
  • postal
    • reg-ex
    • country
  • range
    • minimum
    • maximum
  • ssn
    • reg-ex
    • country
  • url
    • strict
  • reg-ex
    • regex
  • own-function
    • name
    • params

All validators have folllowing commont properties:

  • name: Rule name used in definition array when field has multiple validators
  • required: Require flag, for more information follow CakePHP documentation.
  • allowEmpty: AllowEmpty flagfor more information follow CakePHP documentation.
  • on: Validator type. Can be NULL/create/update. For more information follow CakePHP documentation.
  • message: Error message for the rule.For more information follow CakePHP documentation.
  • last: Flag used when one field have multiple validators. More information about last flag in CakePHP documentation .
18 Jul 2010