Answers true if the given data value and user value match (i.e. the value is selected).

@param mixed $dataValue
@param mixed $userValue

@return boolean
772299
public function isSelectedValue($dataValue, $userValue)
    {
        if (is_array($userValue) && in_array($dataValue, $userValue)) {
            return true;
        }
        
        return parent::isSelectedValue($dataValue, $userValue);
    }
1229685
final public function when($key, $defaultValue = false)
    {
        $data = $this->data($key, false);
        return !empty($data) ? $data : $defaultValue;
    }
1358290
private function exists($propName, $propValue, $userId = null)
    {
        /** @var QueryBuilder $qb */
        $qb = $this->om->createQueryBuilder();
        $qb
            ->select('COUNT(DISTINCT user)')
            ->from('Claroline\CoreBundle\Entity\User', 'user')
            ->where('user.'.$propName.' = :value')
            ->setParameter('value', $propValue);

        if (isset($userId)) {
            $parameter = is_numeric($userId) ? 'id' : 'uuid';
            $qb->andWhere("user.{$parameter} != :{$parameter}")->setParameter($parameter, $userId);
        }

        return 0 < $qb->getQuery()->getSingleScalarResult();
    }
1308826
public function containsValuesEqualToVariableDefaultOnly()
    {
        $data = $this->getDataPlaceHolder();
        
        foreach ($data as $variable) {
            $value = $variable->getValue();
            $default = $variable->getDefaultValue();
            
            if (Utils::isNull($value) === true) {
                if (Utils::isNull($default) === false) {
                    return false;
                }
            } elseif ($value->equals($default) === false) {
                return false;
            }
        }
        
        return true;
    }
1048739
public function isCountryAllowedForUser($userId, $country)
    {

        $query = $this->createQueryBuilder('p')
            ->select('p')
            ->where('p.user = :userId')
            ->setParameter('userId', $userId)
            ->getQuery();

        $data = $query->getResult();
        $return = false;

        foreach ($data as $availableCountries) {
            /** @var \PServerCore\Entity\AvailableCountries $availableCountries */
            if ($availableCountries->getCntry() == $country) {
                $return = true;
                break;
            }
        }
        return $return;
    }
800549
protected function isNodeChoiceAttribute($attributeValue)
    {
        return is_array($attributeValue)
        && (
            array_key_exists('contentNodeId', $attributeValue) ||
            array_key_exists('nodeName', $attributeValue) ||
            array_key_exists('nodeToLink', $attributeValue)
        );
    }
377261
private function validateUser($user, $requireValue = false)
    {
        // If we're passed something falsy, just return null
        if (!$user && !$requireValue) {
            return null;
        }

        // If we have a known supported type, resolve the id and return it
        if ($user instanceof User || $user instanceof UserInfo) {
            return (int) $user->getUserID();
        }

        // If what we're left with is numeric, return it as an int
        if (is_numeric($user)) {
            return (int) $user;
        }

        throw new \InvalidArgumentException('Invalid user value passed, must be User instance or int');
    }
930624
public boolean isMatched(String value, Boolean defaultValue)
    {
        // @todo: there isn't a defaultValue for radio button, what should we do here?
        if (value == null)
            return false;
        if (_match != null)
            return value.equals(_match);
        if (_defaultRadio != null)
            return value.equals(_defaultRadio);

        return false;
    }
1335795
public static function strictCheck (string $firstValue, string $secondValue) : bool
	{
		return $firstValue === $secondValue ? TRUE : FALSE;
	}
782746
protected function isMatchScalarWithArray($value, $contextValue, $name)
    {
        if (!\is_array($value)) {
            return $this->isMatchScalarInArray($value, $contextValue, $name);
        }

        return self::OPERATOR_NOT === \key($value)
            ? !$this->isMatchScalarInArray(\current($value), $contextValue, $name)
            : false;
    }
296191
public function isValid($mixValue){
		if(is_null($mixValue)){
			return true;
		}

		if(is_object($mixValue)){
			if($this->hasOption('class')){
				$strClass = $this->options()->class;

				if($mixValue instanceof $strClass){
					return true;
				}else{
					throw new ClassException($mixValue, $strClass);
					return false;
				}
			}
			return true;
		}
		return false;
	}
1071782
protected function convertValue($propertyValue, $dataType)
    {
        $parsedType = TypeHandling::parseType($dataType);

        // This hardcoded handling is to circumvent rewriting PropertyMappers that convert objects. Usually they expect the source to be an object already and break if not.
        if (!TypeHandling::isSimpleType($parsedType['type']) && !is_object($propertyValue) && !is_array($propertyValue)) {
            return null;
        }

        $conversionTargetType = $parsedType['type'];
        if (!TypeHandling::isSimpleType($parsedType['type'])) {
            $conversionTargetType = 'array';
        }
        // Technically the "string" hardcoded here is irrelevant as the configured type converter wins, but it cannot be the "elementType"
        // because if the source is of the type $elementType then the PropertyMapper skips the type converter.
        if ($parsedType['type'] === 'array' && $parsedType['elementType'] !== null) {
            $conversionTargetType .= '<' . (TypeHandling::isSimpleType($parsedType['elementType']) ? $parsedType['elementType'] : 'string') . '>';
        }

        $propertyMappingConfiguration = $this->createConfiguration($dataType);
        $convertedValue = $this->propertyMapper->convert($propertyValue, $conversionTargetType, $propertyMappingConfiguration);
        if ($convertedValue instanceof \Neos\Error\Messages\Error) {
            throw new PropertyException($convertedValue->getMessage(), $convertedValue->getCode());
        }

        return $convertedValue;
    }
514323
public function check(\ArrayAccess $keyvalue)
    {
        foreach ($this as $key => $value) {
            if (!($keyvalue->offsetExists($key) && ($keyvalue->offsetGet($key) === $value))) {
                return false;
            }
        }

        return true;
    }
266038
public function isRemove($newValue = null)
    {
        if (null !== $newValue) {
            $this->isRemove = (bool) $newValue;
        }
        return $this->isRemove;
    }
724149
protected function isPriceValid($priceValue)
    {
        $floatType = new FloatType();
        if (!$floatType->isValid($priceValue) || $priceValue <= 0) {
            throw new InvalidConditionValueException(
                \get_class(),
                'price'
            );
        }

        return true;
    }
1290847
protected function isPwdChangeAllowed(array $data, UserInterface $user, $errorExtension): bool
    {
        $form = $this->changePasswordForm;
        $form->setData($data);
        if (!$form->isValid()) {
            $this->flashMessenger->setNamespace(AccountController::ERROR_NAME_SPACE . $errorExtension)
                ->addMessage('Form not valid.');
            return false;
        }

        $data = $form->getData();

        if (!$user->hashPassword($user, $data['currentPassword'])) {
            $this->flashMessenger->setNamespace(AccountController::ERROR_NAME_SPACE . $errorExtension)
                ->addMessage('Wrong Password.');
            return false;
        }

        return true;
    }
383599
final public static function compareValues ($firstValue, $secondValue) : int
	{
		if (!self::hasValue($firstValue, $secondValue)) new ErrorCode(1001);
	    return $firstValue <=> $secondValue;
	}