我有兩個實體候選人並具有許多PROGRAMTYPE一一對應關係@assert NotEqualTo()不工作
Candidate.php:
/**
* @ORM\ManyToOne(targetEntity="ProgramType", inversedBy="candidates")
* @ORM\JoinColumn(name="program_type", referencedColumnName="id")
* @Assert\NotBlank(message="lead.programtype.not_blank",groups={"registration","profile"})
* @Assert\NotEqualTo("1",groups={"registration","profile"})
*/
public $programtype;
ProgramType.php:
/**
* One ProgramType has Many Candidates.
* @ORM\OneToMany(targetEntity="Candidate", mappedBy="programtype")
*/
private $candidates;
public function __construct() {
$this->candidates = new ArrayCollection();
}
問題是這條線@Assert\NotEqualTo("1",groups={"registration","profile"})
。 assert語句不起作用。有任何想法嗎?
是否沒有團體合作? – svgrafov
沒有它沒有組沒有工作 – utkarsh2k2