$counter = $context->getQuotaPerWeek(); if (!empty($counter)) { $success &= PolicyController::validateCounterForPeriod($counter, 'per_week', $validationErrors); } $counter = $context->getQuotaPerMonth(); if (!empty($counter)) { $success &= PolicyController::validateCounterForPeriod($counter, 'per_month', $validationErrors); }