Answers true if every viewport field is equal to the given value.

@param mixed $value Value to test.

@return boolean
556319
public function allEqualTo($value)
    {
        foreach ($this->getViewports() as $viewport) {
            
            if ($this->getField($viewport) != $value) {
                return false;
            }
            
        }
        
        return true;
    }
478841
public function fieldValueEquals($field, $value, TraversableElement $container = null)
    {
        $node = $this->fieldExists($field, $container);
        $actual = $node->getValue();
        $regex = '/^'.preg_quote($value, '/').'$/ui';

        $message = sprintf('The field "%s" value is "%s", but "%s" expected.', $field, $actual, $value);

        $this->assert((bool) preg_match($regex, $actual), $message);
    }
917055
public function isValid($value)
    {
        $this->setValue($value);

        if (!$this->layoutManager->isLayoutValid($this->currentSite, $value)) {
            $this->error(self::MAIN_LAYOUT);

            return false;
        }

        return true;
    }
972504
protected function resolveValue($value)
    {
        if (is_array($value)) {
            $this->value = $value['module'];
        } else {
            $this->value = $value;
        }
        return true;
    }
1321219
public static function isValid($value)
    {
        if($value === null){
            return false;
        }

        $reflection = new \ReflectionClass(get_called_class());
        return in_array($value, $reflection->getConstants());
    }
1362514
protected function hasValue($value)
    {
        $value = (int) $value;

        return isset(static::$names[$value]) || array_key_exists($value, static::$names);
    }
123457
public function isValid($value)
    {
        $query = (new \Cms\Orm\CmsFileQuery)
            ->byObject($this->_getObjectName(), $this->getObjectId());
        if ($this->getClass()) {
            $query->andFieldClass()->equals($this->getClass());
        }
        if ($this->getActive() !== null) {
            $query->andFieldActive()->equals($this->getActive());
        }
        if (!$query->count()) {
            $this->_error(self::INVALID);
            return false;
        }
        return true;
    }
887063
public static function determineComparison($value)
    {
        switch (true) {
            case is_scalar($value): {
                return static::EQ;
            }
            case is_array($value): {
                return static::IN;
            }
            case null === $value: {
                return static::IS_NULL;
            }
            default: {
                return static::RAW;
            }
        }
    }
1168821
public function equals($value)
    {
        $id = ($value instanceof ElementXRef) ? $value->getId() : $value;

        return $this->getId() == $id;
    }
303897
public static function isTraversable($value)
    {
        return is_array($value) || (is_object($value) &&  (get_class($value) == 'stdClass' || $value instanceof \Traversable));
    }
523508
public function contains($value): bool
    {
        if (null === $value) {
            return false;
        }

        if ($this->belowMinBorder($value)) {
            return false;
        }

        return !$this->aboveMaxBorder($value);
    }
337435
private function hasOperators($value)
    {

        if (!is_array($value) && !is_object($value)) {
            return false;
        }

        if (is_object($value)) {
            $value = get_object_vars($value);
        }

        foreach ($value as $key => $subValue) {
            if (true === $this->isOperator($key)) {
                return true;
            }
        }
        return false;
    }
1033453
public function equals($value) {
        if ($value instanceof StringClass) {
            $value = $value->getValue();
        }
        if (!is_string($value)) return false;
        return strcmp($this->value, $value) === 0;
    }
1312272
protected function isValueTooHigh($value)
    {
        // check if the value is not to high.
        if ($this->max !== null) {
            if (((function_exists('bcsub') && floatval(bcsub(
                $this->max,
                $value,
                4
            )) < 0) || $value > $this->max) && ((string)$this->max) != ((string)$value)
            ) {
                return true;
            }
        }
        return false;
    }
381300
protected function isSoftSmall($value)
    {
        if (!is_scalar($value) || $value === null) {
            return false;
        }
        
        $value = (float) $value;
        
        return $value >= 0 && $value <= 9;
    }
1002341
protected function parsevalue($value)
    {
        //make sure the whole value can be mapped
        if (!is_array($value) && !$value instanceof \ArrayAccess && !is_object($value)) {
            return false;
        }

        return $this->rParseValue($value);
    }
629668
public function isCompatible($value) {
		// If null, we are compatible
		if ($value === null) {
			return true;
		}
		
		// If the value passed is an array
		if (is_array($value)) {
			// Let's check if this type is an array.
			if (!$this->isArray()) {
				return false;
			}
			if (!$this->isAssociativeArray()) {
				// Let's check if the array passed in parameter has string values as keys.
				foreach ($value as $key=>$val) {
					if (is_string($key)) {
						return false;
					}
				}
			}
			// Now, let's test each subkey for compatibility
			foreach ($value as $key=>$val) {
				if (!$this->subType->isCompatible($val)) {
					return false;
				}
			}
			return true;
		} elseif ($value instanceof MoufInstanceDescriptor) {
			// Let's check if the instance descriptor is compatible with our type.
			if ($this->isPrimitiveType()) {
				return false;
			}
			if ($this->type == "array") {
				return false;
			}
			$classDescriptor = $value->getClassDescriptor();
			if (ltrim($this->type,'\\') == ltrim($classDescriptor->getName(), '\\')) {
				return true;
			}
			//$type = new MoufReflectionClass($this->getType());
			$result =  $classDescriptor->isSubclassOf($this->getType());
			return $result;
		} else {
			// The value is a primitive type.
			if ($this->isPrimitiveType()) {
				return true;
			} else {
				return false;
			}
		}
	}