This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/Validator/Fixtures/DynamicConstraintsEntity.php
2012-01-14 02:06:07 +01:00

22 lines
589 B
PHP

<?php
namespace Symfony\Tests\Component\Validator\Fixtures;
use Symfony\Component\Validator\ConstraintProviderInterface;
use Symfony\Component\Validator\Mapping\ClassMetadata;
class DynamicConstraintsEntity implements ConstraintProviderInterface
{
protected $firstValue;
public function getSecondValue() {
return null;
}
public function getConstraints(ClassMetadata $metadata)
{
$metadata->addPropertyConstraint('firstValue', new FailingConstraint());
$metadata->addGetterConstraint('secondValue', new FailingConstraint());
}
}