Check if a value is a valid ObjectId

@link http://php.net/manual/en/mongoid.isvalid.php
@param mixed $value The value to check for validity.
@return bool
163938
public static function isValid($value)
    {
        if ($value instanceof ObjectID || $value instanceof MongoId) {
            return true;
        } elseif (! is_string($value)) {
            return false;
        }

        return (bool) preg_match('#^[a-f0-9]{24}$#i', $value);
    }
292318
public function isValid($value)
    {
        if (false === Core::get()->classExists($value)) {
            $errorMessage = $this->translateErrorMessage('validator.class_exists.not_valid', 'configuration_object', [$value]);
            $this->addError($errorMessage, 1457610460);
        }
    }
1319492
protected function isValueValid($value) {
		$this->checkValue($value);
		
		if ($this->validatable === null) {
			return true;
		}
		
		return $this->validatable->testEiFieldValue($this->eiu, $value);
	}
132956
public function validateValue( $value ) : bool
   {

      if ( false === $this->hasValidator() )
      {
         return true;
      }

      return (bool) ( $this->_validator )( $value );

   }
939348
protected function isValid($value)
    {
        if ($value === null) {
            $this->addError('This property is required.', 1221560910);
        }
        if ($value === '') {
            $this->addError('This property is required.', 1221560718);
        }
        if (is_array($value) && empty($value)) {
            $this->addError('This property is required', 1354192543);
        }
        if (is_object($value) && $value instanceof \Countable && $value->count() === 0) {
            $this->addError('This property is required.', 1354192552);
        }
    }
698285
public function isValueValid($value) {
		return $value instanceof DataType\TextType || $value instanceof Type\Thing || $value instanceof DataType\URLType;
	}
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;
    }
1321219
public static function isValid($value)
    {
        if($value === null){
            return false;
        }

        $reflection = new \ReflectionClass(get_called_class());
        return in_array($value, $reflection->getConstants());
    }
186143
public function isValueValid($value) {
		return $value instanceof Type\AlignmentObjectType || $value instanceof Type\CourseType || $value instanceof DataType\TextType;
	}
333365
public function isValid($value)
    {
        $this->_setValue($value);

        if (!$value || !is_string($value) && !is_int($value) && !is_float($value)) {
            $this->_error(self::INVALID_PRICE);
            return false;
        }

        if (false === $this->_options['negative'] && '-' === $value[0]) {
            $this->_error(self::PRICE_NEGATIVE, $value);
            return false;
        }

        $status = @preg_match($this->_pattern, $value);
        if (false === $status) {
            $this->_error(self::INVALID_PRICE);
            return false;
        }

        if (!$status) {
            $this->_error(self::INVALID_PRICE);
            return false;
        }

        return true;
    }
353871
public function isValid($value) 
    {
        $valid = Zend_Ldap_Dn::checkDn($value);
        if ($valid === false) {
            $this->_error(self::MALFORMED);
            return false;
        }
        return true;
    }
598000
public function isValueValid($value) {
		return $value instanceof Type\CreativeWork || $value instanceof Type\Product || $value instanceof DataType\URLType;
	}
849695
public static function isValid($value): bool
    {
        try {
            self::decode($value);

            return true;
        } catch (\Throwable $e) {
            return false;
        }
    }
14798
public function isValueValid($value) {
		return $value instanceof Type\MonetaryAmount || $value instanceof DataType\NumberType || $value instanceof Type\PriceSpecification;
	}
132530
public function isValid($value)
    {
        if (!is_null($value) && !is_string($value) && !is_int($value) && !is_float($value) &&
            !is_bool($value) && !is_array($value)) {
            $this->_error(self::INVALID);
            return false;
        }
        if (is_string($value) && (('' === $value) || preg_match('/^\s+$/s', $value))) {
            $this->_error(self::INVALID);
            return false;
        } elseif (is_int($value) && (0 === $value)) {
            return true;
        } elseif (!is_string($value) && empty($value)) {
            $this->_error(self::INVALID);
            return false;
        }
        return true;
    }
440016
public function isValid($value)
    {
        if ($value !== null && !is_string($value) && !is_int($value) && 
            !is_float($value) && !is_bool($value) && !is_array($value) &&
            !is_object($value)
        ) {
            $this->error(self::INVALID);
            return false;
        }
        
        $type = $this->getType();
        $this->setValue($value);
        $object  = false;

        // OBJECT_COUNT (countable object)
        if ($type & self::OBJECT_COUNT) {
            $object = true;

            if (is_object($value) && ($value instanceof \Countable) &&
                (count($value) === 0)) {
                return true;
            }
        }

        // OBJECT_STRING (object's toString)
        if ($type & self::OBJECT_STRING) {
            $object = true;

            if ((is_object($value) && (!method_exists($value, '__toString'))) ||
                (is_object($value) && (method_exists($value, '__toString')) &&
                (((string) $value) === ""))) {
                return true;
            }
        }

        // OBJECT (object)
        if ($type & self::OBJECT) {
            // Fall through. Objects are always considered not empty.
        } elseif ($object === false) {
            // If object not allowed but object given then return false.
            if (is_object($value)) {
                $this->error(self::INVALID);
                return false;
            }
        }

        // SPACE ('   ')
        if ($type & self::SPACE) {
            if (is_string($value) && (preg_match('/^\s+$/s', $value))) {
                return true;
            }
        }

        // NULL (null)
        if ($type & self::NULL) {
            if ($value === null) {
                return true;
            }
        }

        // EMPTY_ARRAY (array())
        if ($type & self::EMPTY_ARRAY) {
            if (is_array($value) && ($value == array())) {
                return true;
            }
        }

        // ZERO ('0')
        if ($type & self::ZERO) {
            if (is_string($value) && ($value == '0')) {
                return true;
            }
        }

        // STRING ('')
        if ($type & self::STRING) {
            if (is_string($value) && ($value == '')) {
                return true;
            }
        }

        // FLOAT (0.0)
        if ($type & self::FLOAT) {
            if (is_float($value) && ($value == 0.0)) {
                return true;
            }
        }

        // INTEGER (0)
        if ($type & self::INTEGER) {
            if (is_int($value) && ($value == 0)) {
                return true;
            }
        }

        // BOOLEAN (false)
        if ($type & self::BOOLEAN) {
            if (is_bool($value) && ($value == false)) {
                return true;
            }
        }

        $this->error(self::IS_NOT_EMPTY);
        return false;
    }
370482
public function isValueValid($value) {
		return $value instanceof Type\Enumeration || $value instanceof Type\PropertyValue || $value instanceof Type\QualitativeValue || $value instanceof Type\QuantitativeValue || $value instanceof Type\StructuredValue;
	}