@param string      $token
@param string|null $identifier

@throws Exception
431217
public function verify($token, $identifier = null)
    {
        $identifier = ($identifier !== null) ? $identifier : $this->identifier;

        // Throw error for empty token or empty identifier, because the server will not handle this
        if (empty($token)) {
            throw new BackupCode\EmptyTokenException();
        }
        if (empty($identifier)) {
            throw new BackupCode\EmptyIdentifierException();
        }

        $this->sendApiCall(self::ACTION_RETRIEVE, sprintf('%s/%s?token=%s', $this->getCreateUrl(), urlencode($identifier), $token));
    }
826514
public function addForm(FormInterface $form, string $identifier)
    {
        if (array_key_exists($identifier, $this->forms)) {
            throw new Exception('A form with the identifier "'.$identifier.'" was already added');
        }
        $this->forms[$identifier] = $form;
    }
692884
public function setByIdentifier($identifier, NodeInterface $node = null)
    {
        $this->nodesByIdentifier[$identifier] = $node;
        if ($node !== null) {
            $this->nodesByPath[$node->getPath()] = $node;
        }
    }
357607
private function decompose($identifier)
	{
		$identifier = base64_decode($identifier);

		if (strstr($identifier, ':'))
		{
			list($token, $path) = explode(':', $identifier, 2);

			$this->token = $token;
			$this->path  = $path;
		}
	}
1170521
public function retrieveByToken($identifier, $token)
	{
		$user = $this->conn->table($this->table)
			->where('id', $identifier)
			->where('remember_token', $token)
			->first();

		return $this->getGenericUser($user);
	}
505082
protected function translateTokenUsingCallback($identifier, $value)
    {
        $method = self::$tokenCallbackMap[$identifier];

        return call_user_func(
            [$this, $method],
            $value
        );
    }
1125855
public function retrieveByToken($identifier, $token)
    {
        $user = $this->createModel()->first(
            ['_id' => $identifier, 'remember_token' => $token]
        );

        return $user;
    }
849130
public function disable(int $identifier): void
    {
        $query = $this->getConnection()->createQueryBuilder();

        $schema = $this->getDatabaseSchema();
        $query
            ->update($this->getTableNameForWriting())
            ->where($this->getPrimaryKeyName() . '=' . $this->createTypedParameter($query, $identifier))
            ->set($schema->getTokensIsEnabledColumn(), $this->createTypedParameter($query, false));

        $numberOfUpdated = $query->execute();
        assert(is_int($numberOfUpdated) === true);
    }
668199
public function retrieveByToken($identifier, $token)
    {
        $model = $this->createModel();

        return $model->newQuery()
            ->where($model->getAuthIdentifierName(), $identifier)
            ->where($model->getRememberTokenName(), $token)
            ->first();
    }
527658
public function retrieveByToken($identifier, $token) {
        /** @var RecordInterface|Authenticatable $userRecord */
        if (!$this->isValidIdentifierValue($identifier)) {
            return null;
        }
        $userRecord = $this->createEmptyUserRecord();
        /** @var RecordInterface $user */
        $user = $userRecord->fromDb([
            $userRecord->getAuthIdentifierName() => $identifier,
            $userRecord->getRememberTokenName() => $token,
        ], [], $this->getRelationsToFetch());

        return $this->validateUser($user, null);
    }
1205393
public static function escapeIdentifier($identifier = null) {
		$sqlAdapter = static::getSQLAdapter();
		return $sqlAdapter->escapeIdentifier($identifier ? $identifier : static::$table);
	}
1186056
public function register($identifier, $value)
    {
        parent::register($identifier, $value);

        $sql = sprintf(
            'INSERT INTO %s (`entityId`, `data`) set (`%s`, `%s`);',
            $this->mysql->quote($this->section),
            $this->mysql->quote($identifier),
            $this->decorator->normalizeValue($value)
        );
        $result = $this->mysql->query($sql);

        if (false === $result) {

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

            $this->throwException(
                'Error occurred while registering an entity: ',
                $this->mysql->errorInfo()
            );
        }
    }
502691
public static function doEscapeIdentifier($Identifier, $instance=null) {
		self::prepareInstance($instance);
		return self::$instances[$instance]->escapeIdentifier($Identifier);
	}
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);
        }
    }
236390
public function read(int $identifier): ?TokenInterface
    {
        try {
            return $this->readResource($identifier);
        } catch (RepositoryException $exception) {
            $message = 'Token reading failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
289309
public function start($identifier = null)
    {
        $this->loadProfile($identifier);
        $this->currentProfile->start();

        return $this;
    }
394872
public function setIdentifier(Identifier $identifier)
    {
        if ($this->identifier !== null) {
            //TODO: throw exception
        }

        $this->identifier = $identifier;

        return $this;
    }