public function update(string $key, $oldValue, $newValue, AbstractElement $element)
	{
		if (!isset($this->index[$key])) {
			throw new MissingAttrIndexException("Attribute index \"$key\" is not defined.");
		}

		$id = $element->getId();

		if (isset($this->index[$key][$oldValue][$id])) {
			unset($this->index[$key][$oldValue][$id]);
		} else {
			throw new MissingElementException("Old value of \"$id\" is not indexed.");
		}

		$this->index[$key][$newValue][$id] = $element;
	}
public function update(string $key, $oldValue, $newValue, AbstractElement $element)
	{
		if (!isset($this->index[$key])) {
			throw new MissingAttrIndexException("Attribute index \"$key\" is not defined.");
		}

		$id = $element->getId();

		if (isset($this->index[$key][$oldValue][$id])) {
			unset($this->index[$key][$oldValue][$id]);
		} else {
			throw new MissingElementException("Old value of \"$id\" is not indexed.");
		}

		$this->index[$key][$newValue][$id] = $element;
	}
public function update ( string $ key , $ oldValue , $ newValue , AbstractElement $ element ) { if ( ! isset ( $ this -> index [ $ key ] ) ) { throw new MissingAttrIndexException ( "Attribute index \"$key\" is not defined." ) ; } $ id = $ element -> getId ( ) ; if ( isset ( $ this -> index [ $ key ] [ $ oldValue ] [ $ id ] ) ) { unset ( $ this -> index [ $ key ] [ $ oldValue ] [ $ id ] ) ; } else { throw new MissingElementException ( "Old value of \"$id\" is not indexed." ) ; } $ this -> index [ $ key ] [ $ newValue ] [ $ id ] = $ element ; }
Update indices to match the changed attribute of the element
Update indices to match the changed attribute of the element