カスタムバリデーターで検証されたエンティティのクラスを取得できるかどうかを知りたいと思います。ここでカスタムバリデーターでエンティティクラスを取得
は、カスタムバリデータである:
use Symfony\Component\Validator\Constraint;
class UniqueKey extends Constraint {
public $message = 'The string "%string%" is not good';
public function validatedBy() {
return get_class($this).'Validator';
}
}
class UniqueKeyValidator extends ConstraintValidator {
public function validate($value, Constraint $constraint) {
// I would like to get the class of the entity validated. Can I?
}
}
[* Class Constraint Validator *](https://symfony.com/doc/current/validation/custom_constraint.html#class-constraint-validator)にすることはできますか? – Yoshi