Add an option to the option cache for easy access through associative arrays.
The option cache associates arguments with their options.

@param string $identifier
@param mixed $option
@throws OptionExistsException
358703
private function addToOptionCache(string $identifier, $option) : void
    {
        if (!isset($option[$identifier])) {
            return;
        }
        $cacheKey = "${option['command']}${option[$identifier]}";
        if (!isset($this->optionsCache[$cacheKey])) {
            $this->optionsCache[$cacheKey] = $option;
        } else {
            throw new OptionExistsException(
                "An argument option with $identifier {$option['command']} {$option[$identifier]} already exists."
            );
        }
    }
158796
public function exists($identifier)
    {
        if (in_array($identifier, self::$reservedVariableNames, true)) {
            return true;
        }

        return array_key_exists($identifier, $this->variables);
    }
685193
public static function getCached($identifier, $accessor) {
    if (!self::isCached($identifier, $accessor)) {
      return false;
    }

    return self::$cache[$identifier][$accessor];
  }
542305
protected static function _mixin($identifier, $instance)
    {
        if (isset(self::$_mixins[$identifier]) && $instance instanceof AnObject) {
            $mixins = self::$_mixins[$identifier];

            foreach ($mixins as $mixin) {
                $instance->mixin($mixin, self::getConfig($mixin));
            }
        }
    }
952176
public function addIdentifier(string $identifier)
    {
        $count = $this->queueRepository->countOpenByIdentifier($identifier);
        if ($count > 0) {
            return;
        }

        $this->logger->debug('SFC Queue add', [$identifier]);

        $data = [
            'cache_url' => $identifier,
            'page_uid' => 0,
            'invalid_date' => \time(),
            'call_result' => '',
        ];

        $this->queueRepository->insert($data);
    }
832977
public function exist(string $identifier, string $fileExtension = '')
    {
        $fileName = $this->getCacheFileName($identifier);
        $cachePath = $this->cacheFolderWithNamespace.'/'.$fileName;

        if (!empty($fileExtension)) {
            $cachePath .= '.'.$fileExtension;
        }
        $file = new File($cachePath);

        if ($file->exists()) {
            return true;
        }

        return false;
    }
485824
public function setIdentifier($identifier) {

		if(false === is_array($identifier)) {
			$identifier = [$identifier];
		}

		$this -> identifier = $identifier;
	}
583276
public function addDecorator($identifier, $prepend = false)
    {
        if($prepend) {
            array_unshift($this->__decorators, $identifier);
        } else {
            array_push($this->__decorators, $identifier);
        }

        return $this;
    }
769146
public function addIdentifier($identifier)
    {
        $this->validateIdentifier($identifier);

        if (in_array($identifier, $this->identifiers)) {
            throw new InvalidIdentifierException('Error: Cannot add the identifier "'.$identifier.'" twice');
        }

        $this->identifiers[] = $identifier;
    }
692884
public function setByIdentifier($identifier, NodeInterface $node = null)
    {
        $this->nodesByIdentifier[$identifier] = $node;
        if ($node !== null) {
            $this->nodesByPath[$node->getPath()] = $node;
        }
    }
218804
public function set_accessible($identifier, $accessible = true) {
        if (is_object($identifier)) {
            $identifier = (int)($identifier->{$this->idfield});
        }
        $this->init_items_access();
        if (is_int($identifier)) {
            $accessible = (int)(bool)$accessible;
            if (!array_key_exists($identifier, $this->accessibleitems) ||
                    $this->accessibleitems[$identifier] != $accessible) {
                $this->accessibleitems[$identifier] = $accessible;
                $this->cachechangedaccessible;
            }
        } else {
            throw new coding_exception('Argument $identifier must be either int or object');
        }
    }
430399
protected function _loop($identifier, $options, $action) {
		$count = $this->_getCount($identifier);
		$offset = 0;
		$limit = $this->params['limit'];

		$this->out(__d('file_storage', '{0} record(s) will be processed.' . "\n", $count));

		do {
			$records = $this->_getRecords($identifier, $limit, $offset);
			if (!empty($records)) {
				foreach ($records as $record) {
					$method = '_' . $action . 'Image';
					try {
						$this->{$method}($record, $options);
					} catch (StorageException $e) {
						$this->err($e->getMessage());
					}
				}
			}
			$offset += $limit;
			$this->out(__d('file_storage', '{0} of {1} records processed.', [$limit, $count]));
		} while ($records->count() > 0);
	}
633400
public function set($identifier, $value)
    {
        $attributes = $this->getData()->attributes;
        $attributes[$identifier] = $value;

        return $this;
    }
316379
public function replace($identifier, $value)
    {
        // store current data to be able to restore on error;
        $oldValue = @$this->registry[$this->section][$identifier];

        parent::replace($identifier, $value);

        $sql = sprintf(
            'UPDATE %s SET `data`=`%s` WHERE `entityId`=`%s`;',
            $this->mysql->quote($this->section),
            $this->mysql->quote($value),
            $this->mysql->quote($identifier)
        );

        $result = $this->mysql->exec($sql);

        if (false === $result) {

            $this->registry[$this->section][$identifier] = $oldValue;

            $this->throwException(
                'Failed to fetch information from the registry: ',
                $this->mysql->errorInfo()
            );
        }
    }
1138609
public synchronized void addSoftwareIdentifier(Identifier identifier) {
        //todo the following assertion should be removed after initial testing and implementation
        assert !(identifier instanceof CpeIdentifier) : "vulnerability identifier cannot be added to software identifiers";

        final Optional<Identifier> found = softwareIdentifiers.stream().filter(id
                -> id.getValue().equals(identifier.getValue())).findFirst();
        if (found.isPresent()) {
            //TODO - should we check for type of identifier?  I.e. could we see a Purl and GenericIdentifier with the same value
            final Identifier existing = found.get();
            if (existing.getConfidence().compareTo(identifier.getConfidence()) < 0) {
                existing.setConfidence(identifier.getConfidence());
            }
            if (existing.getNotes() != null && identifier.getNotes() != null) {
                existing.setNotes(existing.getNotes() + " " + identifier.getNotes());
            } else if (identifier.getNotes() != null) {
                existing.setNotes(identifier.getNotes());
            }
            if (existing.getUrl() == null && identifier.getUrl() != null) {
                existing.setUrl(identifier.getUrl());
            }
        } else {
            this.softwareIdentifiers.add(identifier);
        }
    }
755047
public function addOption($option, $value = null)
    {
        if (is_array($option)) {
            $this->options = $option + $this->options;
        } else {
            $this->options[$option] = $value;
        }
    }
554945
public function set_method($identifier, $data, $ttl)
    {
        extract($identifier);

        $directory = $this->_prep_path($class, $method);

        // create a unique field name
        $filename = $this->_hash($args);

        // does a cache exist for this method? If so we leave the ttl
        if ($this->exists($filename, $directory)) {
            $ttl = null;
        }

        return $this->_write($filename, $data, $directory, $ttl);
    }