isPrototype()) { return; } if ($model->hasExistingTimesheet() || $model->hasNewTimesheet()) { if ($model->getActivity() === null) { $this->context->buildViolation($constraint->messageActivityRequired) ->atPath('activity') ->setCode(QuickEntryModelConstraint::ACTIVITY_REQUIRED) ->addViolation(); } if ($model->getProject() === null) { $this->context->buildViolation($constraint->messageProjectRequired) ->atPath('project') ->setCode(QuickEntryModelConstraint::PROJECT_REQUIRED) ->addViolation(); } } } }