示例#1
0
文件: Post.php 项目: cubiche/cubiche
 /**
  * {@inheritdoc}
  */
 public static function loadValidatorMetadata(ClassMetadata $classMetadata)
 {
     $classMetadata->addPropertyConstraint('title', Assert::stringType()->notBlank());
     $classMetadata->addPropertyConstraint('content', Assert::stringType());
     $classMetadata->addPropertyConstraint('title', Assert::intType()->notBlank(), 'foo');
     $classMetadata->addPropertyConstraint('content', Assert::intType()->notBlank(), 'foo');
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public static function loadValidatorMetadata(ClassMetadata $classMetadata)
 {
     $classMetadata->addPropertyConstraint('email', Assert::email());
     $classMetadata->addPropertyConstraint('password', Assert::stringType()->notBlank());
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public static function loadValidatorMetadata(ClassMetadata $classMetadata)
 {
     $classMetadata->addPropertyConstraint('email', Assert::email());
 }