Checks if `$classes` are part of the `$options['class']`.

@param array|string $classes Name of class(es) to check.
@param array $options An array of HTML attributes and options.
@return bool False if one or more class(es) do not exist.
546434
public function checkClasses($classes, array $options)
    {
        if (empty($options['class'])) {
            return false;
        }

        $options['class'] = $this->_toClassArray($options['class']);
        $classes = $this->_toClassArray($classes);

        foreach ($classes as $class) {
            if (!in_array($class, $options['class'])) {
                return false;
            }
        }

        return true;
    }
476683
protected static function selectClassExtends(array $classes, string $parentClass): iterable
    {
        foreach ($classes as $className) {
            if (static::classExtends($className, $parentClass) === true) {
                yield $className;
            }
        }
    }
1079187
private function _isClassInList($class, $classes)
    {
        $items = explode(" ", trim($classes));
        if (count($items) > 0) {
            foreach ($items as $item) {
                if (strcasecmp($class, trim($item)) == 0) {
                    return true;
                }
            }
        }
        return false;
    }
108770
public static function hasOne($attr, $options=null)
    {
        $cls = get_called_class();
        if (!array_key_exists($cls, self::$_has_one)) {
            self::$_has_one[$cls] = array();
        }
        self::$_has_one[$cls][$attr] = $options ? $options : false;
    }
77720
public function setClasses($classes, $default = null)
    {
        if ($component = $this->getComponentByType(GridFieldAddNewMultiClass::class)) {
            $component->setClasses($classes, $default);
        }
        
        return $this;
    }
488681
protected function addErrorClass(&$options)
    {
        $errors = $this->formHelper->getRequest()->getSession()->get('errors');

        if ($errors && $errors->has($this->getNameKey())) {
            $errorClass = $this->formHelper->getConfig('defaults.wrapper_error_class');

            if ($options['wrapper'] && !str_contains($options['wrapper']['class'], $errorClass)) {
                $options['wrapper']['class'] .= ' '.$errorClass;
            }
        }

        return $options;
    }
690202
protected function _options($options, $class)
    {
        $options += [
            'from' => $class::now(),
            'timezone' => null,
            'format' => $class::$wordFormat,
            'accuracy' => $class::$wordAccuracy,
            'end' => $class::$wordEnd,
            'relativeString' => __d('cake', '%s ago'),
            'absoluteString' => __d('cake', 'on %s'),
        ];
        if (is_string($options['accuracy'])) {
            $accuracy = $options['accuracy'];
            $options['accuracy'] = [];
            foreach ($class::$wordAccuracy as $key => $level) {
                $options['accuracy'][$key] = $accuracy;
            }
        } else {
            $options['accuracy'] += $class::$wordAccuracy;
        }

        return $options;
    }
84519
public function remove_class($class) {
        if (in_array($class, $this->classes)) {
            $key = array_search($class,$this->classes);
            if ($key!==false) {
                unset($this->classes[$key]);
                return true;
            }
        }
        return false;
    }
883401
protected function bootstrap(array $classes): array
    {
        foreach ($classes as $index => $class) {
            $classes[$index] = $this->app->make($class)->bootstrap();
        }

        return $classes;
    }
799150
protected function _classesExtends($names, array $classes, array &$logs = array())
    {
        if (!is_array($names)) {
            $names = array($names);
        }
        foreach ($names as $_name) {
            foreach ($classes as $_class) {
                if (class_exists($_class)) {
                    if (CodeHelper::extendsClass($_name, $_class)) {
                        return true;
                    }
                } else {
                    $logs[] = $this->_getErrorMessage('Class "%s" not found!', $_class);
                }
            }
        }
        return false;
    }
625894
final public function hasclass($classname)
    {
        return !!$this->hasattr('class')?in_array($classname, explode(' ', $this->attrs->class)):FALSE;
    }
411854
static private function checkRangeDomain($res, string $class): bool {
        if ($class == '') {
            return true;
        }

        if (is_a($res, 'EasyRdf\Literal')) {
            //TODO check xsd types against literal values
            return true;
        } else {
            $classes = array();
            foreach ($res->allResources(self::RDFS_TYPE) as $i) {
                $i         = $i->getUri();
                $classes[] = $i;
                if (isset(self::$classes[$i])) {
                    $classes = array_merge($classes, self::$classes[$i]);
                }
            }
            return in_array($class, $classes);
        }
    }
490546
private function checkFormClass($type, $classes)
    {
        return array_filter($classes, function ($subclass) use ($type) {
            return is_a($type, $subclass, true);
        });
    }
334530
public function areValidModules(string $category, array $classes): bool {
        foreach ($classes as $class) {
            if (!$this->isValidModule($category, $class)) {
                return false;
            }
        }

        return true;
    }
522375
public function setClasses( $classes )
	{
		$this->attributes['class']	= array();
		if( is_string( $classes ) )
			$classes	= explode( " ", $classes );
		if( !is_array( $classes ) && !( $classes instanceof ArrayIterator ) )
			throw new InvalidArgumentException( 'Class attribute must be string, array or iterator' );
		foreach( $classes as $class )
			$this->addClass( $class );
	}
386579
public function setTableExtraClasses($classes = array())
  {
    if( ! empty($classes) )
    {
      // validate classes
      foreach($classes as $class)
      {
        if(str_word_count($class) > 1)
        {
          throw new \InvalidArgumentException;
        }
      }
      $this->table_extra_classes = $classes;
    }
  }
992491
public function asModel($class, $options = [])
    {
        $m = $this->newInstance($class, $options);

        foreach ($this->data as $field=> $value) {
            if ($value !== null && $value !== $this->getField($field)->default) {

                // Copying only non-default value
                $m[$field] = $value;
            }
        }

        // next we need to go over fields to see if any system
        // values have changed and mark them as dirty

        return $m;
    }