propelorm/Propel2

View on GitHub
src/Propel/Generator/Behavior/Validate/templates/objectLoadValidatorMetadata.php
A

No issues here. Congrats!


/**
 * Configure validators constraints. The Validator object uses this method
 * to perform object validation.
 *
 * @param ClassMetadata $metadata
 */
static public function loadValidatorMetadata(ClassMetadata $metadata)
{
<?php foreach($constraints as $constraint) : ?>
    $metadata->addPropertyConstraint('<?php echo $constraint['column']; ?>', new <?php echo $constraint['validator']; ?>(<?php  echo((isset($constraint['options'])) ? $constraint['options'] : ''); ?>));
<?php endforeach; ?>
}

Size

Lines of code
6