Validates a product bundle data
@return bool
186852
protected function validateEditProductBundle()
    {
        $this->setSubmitted('product');
        $this->setSubmitted('product_id', $this->data_product['product_id']);

        $this->validateComponent('product_bundle');

        return !$this->hasErrors();
    }
593745
public function is_valid() {
        $ret = false;

        if (is_null($this->name) === false && is_null($this->type) === false &&
            (is_null($this->subtype) === false || $this->type !== 'DISTRIBUTIONLIST') &&
            is_null($this->subscriberList) === false
        ) {
            $ret = true;
        }

        return $ret;
    }
525291
protected function validateEditProduct()
    {
        $this->setSubmitted('product', null, false);
        $this->setSubmittedBool('status');
        $this->setSubmittedBool('subtract');
        $this->setSubmitted('form', true);
        $this->setSubmitted('update', $this->data_product);

        if (isset($this->data_product['product_id'])) {
            $this->setSubmitted('user_id', $this->data_product['user_id']);
            $this->setSubmitted('created', $this->data_product['created']);
            $this->setSubmitted('modified', $this->data_product['modified']);
            $this->setSubmitted('currency', $this->data_product['currency']);
            $this->setSubmitted('product_id', $this->data_product['product_id']);
        } else {
            $this->setSubmitted('user_id', $this->uid);
            $this->setSubmitted('currency', $this->currency->getDefault());
        }

        $this->validateComponent('product');

        return !$this->hasErrors();
    }
743724
public function IsValidForCurrentUser()
    {
        $bValidForUser = parent::IsValidForCurrentUser();
        if (false === $bValidForUser) {
            return $bValidForUser;
        }

        if (false === $this->fieldPkgDhlPackstationAllowForPackstation) {
            $oUser = TdbDataExtranetUser::GetInstance();
            $oShipping = $oUser->GetShippingAddress();
            if ($oShipping && $oShipping->fieldIsDhlPackstation) {
                $bValidForUser = false;
            }
        }

        return $bValidForUser;
    }
1062763
protected function validateSubtractProduct()
    {
        $field = 'subtract';
        $value = $this->getSubmitted($field);

        if (isset($value)) {
            $this->setSubmitted($field, filter_var($value, FILTER_VALIDATE_BOOLEAN));
        }

        return true;
    }
319937
public function valid()
    {

        if ($this->container['typeId'] === null) {
            return false;
        }
        if ($this->container['quantity'] === null) {
            return false;
        }
        if ($this->container['locationId'] === null) {
            return false;
        }
        if ($this->container['locationType'] === null) {
            return false;
        }
        $allowedValues = $this->getLocationTypeAllowableValues();
        if (!in_array($this->container['locationType'], $allowedValues)) {
            return false;
        }
        if ($this->container['itemId'] === null) {
            return false;
        }
        if ($this->container['locationFlag'] === null) {
            return false;
        }
        $allowedValues = $this->getLocationFlagAllowableValues();
        if (!in_array($this->container['locationFlag'], $allowedValues)) {
            return false;
        }
        if ($this->container['isSingleton'] === null) {
            return false;
        }
        return true;
    }
1146104
public function validate(): bool
    {
        $pathItemValid = $this->_pathItem === null || $this->_pathItem->validate();
        return $pathItemValid && empty($this->_errors);
    }
155192
public function isValid() : bool
   {

      if ( $this->_support->hasAttribute( $this->_requiredAttributeName ) )
      {
         return true;
      }

      return $this->_support->hasAttribute( $this->_altAttributeName );

   }
333303
private function checkProduct(){
		$product =  explode('/',trim($this->data[0]));
		if (count($product) !== 2) {
			return false;	
		}
		list($this->report['product'], $this->report['productVersion']) =$product;
		unset($this->data[0]);
		$this->data = $this->reindex($this->data);
		return true;
	}
1077478
protected function validateEditProductClass()
    {
        $this->setSubmitted('product_class');
        $this->setSubmittedBool('status');
        $this->setSubmitted('update', $this->data_product_class);

        $this->validateComponent('product_class');

        return !$this->hasErrors();
    }
986507
protected function ValidateStepData()
    {
        $bContinue = $this->ValidateUser($this->GetUserData());

        // which address do we need to validate? if $this->GetShipToBillingAddress() != 1 then we need to validate both..
        // otherwise one will do...

        if ('1' != $this->GetShipToBillingAddress()) {
            $bContinue = $this->ValidateShippingAddress($this->GetShippingAddressData()) && $bContinue;
            $bContinue = $this->ValidateBillingAddress($this->GetBillingAddressData()) && $bContinue;
        } else {
            switch ($this->AddressUsedAsPrimaryAddress()) {
                case TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING:
                    $bContinue = $this->ValidateShippingAddress($this->GetShippingAddressData()) && $bContinue;
                    break;

                default:
                case TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING:
                    $bContinue = $this->ValidateBillingAddress($this->GetBillingAddressData()) && $bContinue;
                    break;
            }
        }

        return $bContinue;
    }
949748
protected function saveProductBundle()
    {
        $this->controlAccess('product_bundle_edit');

        $product_id = $this->getSubmitted('product_id');
        $products = $this->getSubmitted('products', array());

        if ($this->product_bundle->set($product_id, $products)) {
            $this->redirect('admin/content/product', $this->text('Product bundle has been updated'), 'success');
        }

        $this->redirect('', $this->text('Product bundle has not been updated'), 'warning');
    }
930978
public function getValidationErrors()
    {
        return [
            /** Bundle option related errors */
            __('The options you selected are not available.')->render(),
            __('The required options you selected are not available.')->render(),
            __('Please specify product option(s).')->render(),
            __('Please select all required options.')->render(),
            __('You need to choose options for your item.')->render(),

            /** Input field related errors */
            __('The text is too long.')->render(),
            __('Please specify product\'s required option(s).')
        ];
    }
797483
function validate()
    {
        $errors = array();

        BagIt_validateExists($this->bagitFile, $errors);
        BagIt_validateExists($this->getDataDirectory(), $errors);
        $this->manifest->validate($errors);

        $this->bagErrors = $errors;
        return $this->bagErrors;
    }
726593
protected function validateQuantityCart()
    {
        $field = 'quantity';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if (!isset($value)) {

            if ($this->isUpdating()) {
                return null;
            }

            $value = 1;
        }

        $label = $this->translation->text('Quantity');

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        if (strlen($value) > 2) {
            $this->setErrorLengthRange($field, $label, 1, 2);
            return false;
        }

        return true;
    }
227876
function validate() {

		// Is this an ODT?
		if ( ! $this->isOdt( $this->outputPath ) ) {

			$this->logError( \Pressbooks\Utility\get_contents( $this->logfile ) );

			return false;
		}

		return true;
	}
674878
protected function validateOptionsCart()
    {
        $product = $this->getSubmitted('product');

        if (empty($product) || $this->isError()) {
            return null;
        }

        $options = array_filter((array) $this->getSubmitted('options'));

        if (empty($options)) {
            $this->setSubmitted('options', array());
            $this->setSubmitted('sku', $product['sku']);
            $this->setSubmitted('stock', $product['stock']);
            return true;
        }

        $combination_id = $this->sku->getCombinationId($options, $product['product_id']);

        if (empty($product['combination'][$combination_id]['status'])) {
            $error = $this->translation->text('Invalid combination');
            $this->setError('options', $error);
            return false;
        }

        $this->setSubmitted('options', $options);
        $this->setSubmitted('combination_id', $combination_id);
        $this->setSubmitted('sku', $product['combination'][$combination_id]['sku']);
        $this->setSubmitted('stock', $product['combination'][$combination_id]['stock']);
        return true;
    }