I am trying to make my app flexible by using configuration files instead of hard-coded stuffs, and come in troubles with validation constraints:
/**
* @var ArrayCollection[SubjectTag]
*
* @ORM\OneToMany(targetEntity="SubjectTag", mappedBy="subject")
* @Assert\Count(max = 15, maxMessage = "You can't create more than 15 tags.")
* @Assert\Valid()
*/
protected $tags;
It would be nicer to do something like:
/**
* @var ArrayCollection[SubjectTag]
*
* @ORM\OneToMany(targetEntity="SubjectTag", mappedBy="subject")
* @Assert\Count(max = "%subject.max_tags%", maxMessage = "You can't create more than %subject.max_tags% tags.")
* @Assert\Valid()
*/
protected $tags;
But by debugging I seen that my parameters were never recovered.
Any way to achieve this ?