Is Valid Item Method

Checks to see if the value is valid to be stored inside the array.
@param mixed $mixValue The value to check.
@return bool
483919
public function isValidItem($mixValue){
		if($this->hasOption('max')){
			if(count($this->mixValue)>=$this->options()->max){
				throw new MaxException($this->options()->max);
				return false;
			}
		}

		return true;
	}
1151919
public function isValidEntity($mixed): bool
    {
        if (empty($this->entityClasses)) {
            return true;
        } else {
            if (is_object($mixed)) {
                foreach ($this->entityClasses as $entityClass) {
                    if (is_a($mixed, $entityClass, true)) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
313295
public function isValid($mixed, ArrayAccess $error = null)
    {
        if (!is_string($mixed)) {
            throw new InvalidArgumentException(t(/*i18n: %s is the name of a PHP class*/'%s only validates string length', __CLASS__));
        }
        $result = @preg_match($this->getPattern(), $mixed);

        if ($result === false) {
            throw new RuntimeException(sprintf('Regex Error: %i', preg_last_error()));
        }

        if (!$result) {
            if ($error && $message = $this->getErrorString(self::E_DOES_NOT_MATCH, $mixed)) {
                $error[] = $message;
            }

            return false;
        }

        return true;
    }
360606
protected function isValidValue($value)
    {
        $valid = true;
        if (is_array($value)) {
            $numericKeys = 0;
            foreach ($value as $k => $v) {
                $numericKeys += is_integer($k);
                if (!$this->isValidValue($v)) {
                    $valid = false;
                    break;
                }
            }
            if (!($numericKeys == 0 || $numericKeys == count($value))) {
                $valid = false;
            }
        } else {
            if (null !== $value && !is_scalar($value)) {
                $valid = false;
            }
        }
        return $valid;
    }
1328514
public function setValue($mixValue){
		if($this->isValid($mixValue)){
			$this->mixValue = array();

			if(is_array($mixValue)){
				//set the array using offsetSet so that checks are carried out on the content of the array
				foreach($mixValue as $strKey => $mixValue){
					$this->offsetSet($strKey, $mixValue);
				}
			}
			return true;
		}

		throw new TypeException($mixValue, get_class($this));
		return false;
	}
544932
public function valid()
    {

        if ($this->container['orderId'] === null) {
            return false;
        }
        if ($this->container['typeId'] === null) {
            return false;
        }
        if ($this->container['regionId'] === null) {
            return false;
        }
        if ($this->container['locationId'] === null) {
            return false;
        }
        if ($this->container['range'] === null) {
            return false;
        }
        $allowedValues = $this->getRangeAllowableValues();
        if (!in_array($this->container['range'], $allowedValues)) {
            return false;
        }
        if ($this->container['isBuyOrder'] === null) {
            return false;
        }
        if ($this->container['price'] === null) {
            return false;
        }
        if ($this->container['volumeTotal'] === null) {
            return false;
        }
        if ($this->container['volumeRemain'] === null) {
            return false;
        }
        if ($this->container['issued'] === null) {
            return false;
        }
        if ($this->container['state'] === null) {
            return false;
        }
        $allowedValues = $this->getStateAllowableValues();
        if (!in_array($this->container['state'], $allowedValues)) {
            return false;
        }
        if ($this->container['minVolume'] === null) {
            return false;
        }
        if ($this->container['walletDivision'] === null) {
            return false;
        }
        if ($this->container['walletDivision'] > 7) {
            return false;
        }
        if ($this->container['walletDivision'] < 1) {
            return false;
        }
        if ($this->container['duration'] === null) {
            return false;
        }
        if ($this->container['escrow'] === null) {
            return false;
        }
        return true;
    }
390244
def validate_wrap(self, value):
        '''  '''
        self.item_type.validate_wrap(value)

        if value not in self.values:
            self._fail_validation(value, 'Value was not in the enum values')
1032545
public function canUseDefaultValue($fieldValue)
    {
        if ($this->getScope() == ContainerScopeInterface::SCOPE_STORE_CONTAINERS && $fieldValue) {
            return true;
        }

        if ($this->getScope() == ContainerScopeInterface::SCOPE_CONTAINERS && $fieldValue) {
            return true;
        }

        return false;
    }
391501
public static function isValid($price)
    {
        //====================================================================//
        // Check Contents Available
        if (!is_array($price) && !($price instanceof ArrayObject)) {
            return false;
        }
        /** @var array|ArrayObject $price */
        if (!isset($price["base"])) {
            return false;
        }
        if (!isset($price["ht"]) || !isset($price["ttc"]) || !isset($price["vat"])) {
            return false;
        }
        if (!self::isValidAmount($price)) {
            return false;
        }
        if (!self::isValidCurrency($price)) {
            return false;
        }

        return true;
    }
399343
protected function isValid($item)
    {
        if ((!$item instanceof stdClass)
            || !isset($item->type)
            || !isset($item->modifiers)
        ) {
            return false;
        }

        if ($this->doctypeValidationEnabled) {
            if (!isset($item->content)
                && (! $this->view->plugin('doctype')->isHtml5()
                || (! $this->view->plugin('doctype')->isHtml5() && $item->type !== 'charset'))
            ) {
                return false;
            }

            // <meta itemprop= ... /> is only supported with doctype html
            if (! $this->view->plugin('doctype')->isHtml5()
                && $item->type === 'itemprop'
            ) {
                return false;
            }

            // <meta property= ... /> is only supported with doctype RDFa
            if (!$this->view->plugin('doctype')->isRdfa()
                && $item->type === 'property'
            ) {
                return false;
            }
        }

        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;
    }
809585
public function setValue($mixValue){
		if(!$this->isValid($mixValue)){
			if($this->hasOption('class')){
				$strClass = $this->options()->class;

				try {
					$mixValue = new $strClass($mixValue);
				}catch (\Exception $e){
					throw new TypeException($mixValue, get_class($this));
				}
			}
		}

		parent::setValue($mixValue);
	}
86440
protected boolean checkvalue(String colorvalue) {

        boolean valid = validateColorValue(colorvalue);
        if (valid) {
            if (colorvalue.length() == 4) {
                char[] chr = colorvalue.toCharArray();
                for (int i = 1; i < 4; i++) {
                    String foo = String.valueOf(chr[i]);
                    colorvalue = colorvalue.replaceFirst(foo, foo + foo);
                }
            }
            m_textboxColorValue.setValue(colorvalue, true);
            m_colorField.getElement().getStyle().setBackgroundColor(colorvalue);
            m_colorValue = colorvalue;
        }
        return valid;
    }
264066
public function validate($value)
    {
        foreach ($this->items as $item) {
            if ($item->validate($value)) {
                return true;
            }
        }

        return false;
    }
614520
public function isValid($mixed, ArrayAccess $error = null)
    {
        if ($mixed !== null && !is_string($mixed)) {
            throw new InvalidArgumentException(t('Invalid type supplied to validator.'));
        }
        if ($this->checkEmail($mixed) === false) {
            if ($error && $message = $this->getErrorString(self::E_INVALID_ADDRESS, $mixed)) {
                $error[] = $message;
            }

            return false;
        }

        return true;
    }
687972
public function set($strProperty, $mixValue){
		$strProperty = $this->_formatPropertyName($strProperty);
		$this->asObject($strProperty)->setValue($mixValue);
	}
556984
public function is_bool($bValue)
    {
        $this->set_message('is_bool', lang('fv_is_bool_field'));
        return is_bool($bValue) || $bValue === '1' || $bValue === '0' || $bValue === 1 || $bValue === 0;
    }