/** * Validate catalog Scope * * @param User $user * @param Constraint $constraint */ protected function validateCatalogScope($user, Constraint $constraint) { if (is_callable(array($user, 'getCatalogScope'))) { if (!$user->getCatalogScope()) { $this->context->addViolation($constraint->missingScopeMessage); } } }