The most recent object created gets remembered by a specific identifier
as long as the current scenario runs.

@param string $identifier
@throws \Exception
519040
public function rememberLastObjectAs($identifier)
	{
		if (array_key_exists($identifier, $this->rememberedObjects)) {
			throw new \Exception(sprintf('The identifier "%s" is already taken', $identifier), 1480605866);
		}
		if (!$this->startObjectTracking) {
			throw new \Exception('Object tracking is not started, so remembering object is not possible.', 1480607437);
		}
		$object = end($this->createdObjects);
		$this->rememberedObjects[$identifier] = $object;
	}
1220258
public function persist(IdentifiableObject $object): void
    {
        $id = (string)$object->id();

        $allData = $this->loadAllObjects();
        $allData[$id] = $object;
        $this->saveAllObjects($allData);

        stdout(line(make_cyan('Persisted'), get_class($object), ':', $id));
    }
577143
public function unregister($identifier)
    {
        $this->load();

        parent::unregister($identifier);
        $this->getDrupalCommonConnector()->variable_set($this->section, $this->registry[$this->section]);
    }
961722
public function loadSectionDataByIdentifier($identifier)
    {
        try {
            return $this->innerGateway->loadSectionDataByIdentifier($identifier);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
181880
public function delete($identifier = null) {
		if ($this->get($identifier) === null) return;
		$this->arrayDelete(self::$_data, '_session_class._standard.' . $this->section . ($identifier !== null ? '.' . $identifier : ''));
	}
289606
public function parseIdentifier(ObjectIdentifier $identifier)
    {
        $info = parent::parseIdentifier($identifier);

        $path  = $identifier->path;

        //Allow locating default classes if $path is empty.
        if(empty($path))
        {
            $info['path']    = $info['file'];
            $info['file']    = '';
            $info['package'] = '';
        }
        else
        {
            $package = array_shift($path);

            $info['path']    = StringInflector::implode($path);
            $info['package'] = ucfirst($package);
        }

        //Make an exception for 'view' and 'module' types
        if(in_array($info['package'], array('View','Module')) && !in_array('behavior', $path)) {
            $info['path'] = '';
        }

        return $info;
    }
948303
public function isRegistered($identifier)
    {
        if (!parent::isRegistered($identifier)) {

            $this->load();

            return parent::isRegistered($identifier);
        }

        return true;
    }
401783
protected function createCache(string $identifier): void
    {
        $frontend = isset($this->cacheConfigurations[$identifier]['frontend']) ? $this->cacheConfigurations[$identifier]['frontend'] : $this->cacheConfigurations['Default']['frontend'];
        $backend = isset($this->cacheConfigurations[$identifier]['backend']) ? $this->cacheConfigurations[$identifier]['backend'] : $this->cacheConfigurations['Default']['backend'];
        $backendOptions = isset($this->cacheConfigurations[$identifier]['backendOptions']) ? $this->cacheConfigurations[$identifier]['backendOptions'] : $this->cacheConfigurations['Default']['backendOptions'];
        $persistent = isset($this->cacheConfigurations[$identifier]['persistent']) ? $this->cacheConfigurations[$identifier]['persistent'] : $this->cacheConfigurations['Default']['persistent'];
        $cache = $this->cacheFactory->create($identifier, $frontend, $backend, $backendOptions, $persistent);
        $this->registerCache($cache, $persistent);
    }
43860
public function isRegistered($identifier)
    {
        if (false === parent::isRegistered($identifier)) {
            $entity = $this->getContentById($identifier);

            if (!empty($entity)) {
                return true;
            }
        } else {

            return true;
        }

        return false;
    }
828462
public static function setIdentifierName(string $identifier): void
    {
        if (empty($identifier)) {
            throw new InvalidArgumentException("Identifier shouldn't be empty.");
        } elseif (\in_array($identifier, ['password'])) {
            throw new InvalidArgumentException("Identifier [{$identifier}] is not allowed!");
        }

        static::$identifier = $identifier;
    }
1071676
public function getAncestor($identifier) {
        $key = $this->has($identifier);
        if ($key > 0) {
            $iterator = $this->getIterator();
            $iterator->seek($key - 1);
            return $iterator->current();
        }
        return false;

    }
566304
public function init($identifier, $slug)
    {
        $this->getModel()->setId($identifier);
        $this->getModel()->setSlug($slug);

        $this->addMetabox();
    }
1057339
public function offsetSet($offset, $identifier)
    {
        if($identifier instanceof ObjectIdentifierInterface)
        {
            $data = array(
                'identifier' =>  $identifier,
                'class'      =>  $this->getClass($identifier)
            );

            apc_store($this->getNamespace().'-object_'.$offset, $data);
        }

        parent::offsetSet($offset, $identifier);
    }
1010956
public function submitItem($identifier, $item)
    {
        $job = $this->getJobFromId($identifier);
        if ($job === null) {
            throw new \RuntimeException(
                "The identifier does not exist: $identifier"
            );
        }
        $idNum = $job->id();
        return $this->processor->submit($item, $idNum);
    }
747919
protected function updateByIdentifier($identifier, $data)
	{
		return $this->aggregate[IdentifierServiceProvider::getProviderKey()]->update($identifier->getEntity(), $data);
	}
505951
public function setIdentifier($identifier)
    {
        if (is_string($identifier) === false || empty($identifier) === true) {
            throw new InvalidArgumentException(
                "The 'identifier' argument must be a non-empty string."
            );
        }
        
        $this->identifier = $identifier;
    }
1037986
public function hasIdentifier($identifier)
    {
        if(!$identifier instanceof ObjectIdentifierInterface) {
            $identifier = $this->getIdentifier($identifier);
        }

        return in_array((string) $identifier, $this->__identifier_list);
    }