내가 가진 클래스심포니는 속성을 확인
Class SubjectSegment{
/**
*@CustomAssert\MyCitizenshipNumber()
*/
private $citizenshipNumber;
/**
*@CustomAssert\MyDate()
*/
private $citizenshipNumberIssuedDate;
}
citizenshipNumber가있는 경우 내가 정말로 원하는 것은 유효 citizenshipNumberIssuedDate입니다 ... 최고입니다 무엇
방법은 당신이에 보일 것이
무엇 난 정말 필요한 것은 @CustomAssert \를 탈출하는 것입니다 MyDate when (null == $ this-> citizenshipNumber). 심포니 2.6을 사용하고 있습니다. – Madhab452
질문에 대한 귀하의 코멘트 답신'if (null === $ this-> citizenshipNumber && null === $ this-> citizenshipNumberIssuedDate) {// put $ context-> addViolation ...}' – pietro
두 경우 모두 (null === $ this-> citizenshipNumber) if (null! = $ this-> citizenshipNumber) {} @CustomAssert \ MyDate()가 유효한지 확인하십시오. – Madhab452