/** * Validate group values. * * @param \Magento\Customer\Api\Data\GroupInterface $group * @throws InputException * @return void * * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ private function _validate($group) { $exception = new InputException(); if (!\Zend_Validate::is($group->getCode(), 'NotEmpty')) { $exception->addError(__(InputException::REQUIRED_FIELD, ['fieldName' => 'code'])); } if ($exception->wasErrorAdded()) { throw $exception; } }
/** * Validate group values. * * @param \Magento\Customer\Api\Data\GroupInterface $group * @throws InputException * @return void * * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ private function _validate($group) { $exception = new InputException(); if (!\Zend_Validate::is($group->getCode(), 'NotEmpty')) { $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'code'])); } if ($exception->wasErrorAdded()) { throw $exception; } }