Flags an attribute as dirty.

@param string $name Attribute name
170087
public function flagDirty($name, $dirty = true)
	{
		if (!$this->_dirty)	$this->_dirty = array();
		if ($dirty) {
			$this->_dirty[$name] = true;
		} else {
			if (array_key_exists($name, $this->_dirty)) {
				unset($this->_dirty[$name]);
			}
		}
	}
269888
public function mark_dirty() {
        global $CFG, $USER, $ACCESSLIB_PRIVATE;

        if (during_initial_install()) {
            return;
        }

        // only if it is a non-empty string
        if (is_string($this->_path) && $this->_path !== '') {
            set_cache_flag('accesslib/dirtycontexts', $this->_path, 1, time()+$CFG->sessiontimeout);
            if (isset($ACCESSLIB_PRIVATE->dirtycontexts)) {
                $ACCESSLIB_PRIVATE->dirtycontexts[$this->_path] = 1;
            } else {
                if (CLI_SCRIPT) {
                    $ACCESSLIB_PRIVATE->dirtycontexts = array($this->_path => 1);
                } else {
                    if (isset($USER->access['time'])) {
                        $ACCESSLIB_PRIVATE->dirtycontexts = get_cache_flags('accesslib/dirtycontexts', $USER->access['time']-2);
                    } else {
                        $ACCESSLIB_PRIVATE->dirtycontexts = array($this->_path => 1);
                    }
                    // flags not loaded yet, it will be done later in $context->reload_if_dirty()
                }
            }
        }
    }
584723
public function remove(string $name): void
    {
        if ($this->has($name)) {
            unset($this->factories[$name]);
        }
    }
822949
protected function isValidAttribute($name)
    {
        $pattern = '~^' . self::ATTRIBUTE_REGEX . '$~i';
        $result = @preg_match($pattern, $name);
        return (bool)$result;
    }
1089710
public function attribute($name, $value=null)
    {
        if ($value === null) {
            unset($this->_attributes[$name]);
        } else {
            $this->_attributes[$name] = $value;
        }
    }
1108422
public function hasChanged($name)
    {
        if ($this->hasOldAttribute($name) && $this->hasNewAttribute($name)) {
            return $this->getOldAttribute($name) != $this->getNewAttribute($name);
        } else {
            // Unknown attribute
        }
    }
641941
public function startAttribute($name, $value)
    {
        $this->checkStartAttribute($name);

        $this->json->{'_' . $name} = $value;
    }
84012
public function __isset( string $name ) {
		return (bool) $this->$name ?? $this->_attributes[ $name ] ?? FALSE;
	}
1369822
public function removeCustomHtmlAttrib($name)
        {
            if (!is_string($name)) {
                throw new Exception(
                    'Invalid argument: $name must be a string'
                );
            }

            if (isset($this->_customHtmlAttribs[$name])) {
                unset($this->_customHtmlAttribs[$name]);
            }
        }
962498
private function getOldAttribute($name)
    {
        if ($this->hasOldAttribute($name)) {
            $collection = $this->getOldAttributes();
            return $collection[$name];
        } else {
            // Error
        }
    }
1328480
private function isIgnoredTag(?string $name): bool
    {
        foreach (self::$ignoreTags as $tag) {
            if (strcasecmp($tag, $name) === 0) {
                return true;
            }
        }

        return false;
    }
781929
public function addFlag(string $name): void
    {
        if (!$this->hasFlag($name)) {
            $flagEntry = $this->entry[PoTokens::FLAG];
            if ($flagEntry === null) {
                $this->set(PoTokens::FLAG, $name);
            } elseif (is_array($flagEntry)) {
                $flagEntry[] = $name;
                $this->set(PoTokens::FLAG, implode(',', $flagEntry));
            } else {
                $this->set(PoTokens::FLAG, $flagEntry . ',' . $name);
            }
        }
    }
339988
public function remove($name): void
    {
        if ($this->contains($name) == false) {
            return;
        }

        unset($this->record[$name]);
    }
752189
public function unsetAttribute($name)
    {
        try {
            parent::__unset($name);
        } catch (\Exception $ignore) {
        }

        if ($this->issetAttribute($name)) {
            $this->setAttribute($name, null);
        }
    }
346905
protected function flagExists(string $name): bool
    {
        $flags = $this->getFlags();

        return isset($flags[$name]);
    }
528257
private function isIgnoredAnnotation($name)
    {
        if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) {
            return true;
        }

        foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) {
            $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\';

            if (0 === stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace)) {
                return true;
            }
        }

        return false;
    }
680755
public function __isset($name)
    {
        return isset($this->attributes[$name]) && null !== $this->attributes[$name];
    }