Check whether a string has been used against an id

@param string $string
@param int$id

@return bool
559219
private function hasBeenUsed($string, $id)
    {
        $repository = $this->entityManager->getRepository(UsedString::class);
        $allUses = $repository->findBy(['subject' => $id], ['id' => 'desc'], $this->maxReuse);

        foreach ($allUses as $use) {
            if ($this->matches($string, $use)) {
                return true;
            }
        }

        return false;
    }
588623
public boolean isSelected(String id) {
        for (JQMCheckbox box : checks) {
            if (id.equals(box.getId()))
                return box.isChecked();
        }
        return false;
    }
1142143
protected function isUnique($id, $url)
    {
        try {
            return $this->loadByUrl($url)->id === $id;
        } catch (NotFoundException $e) {
            return true;
        }
    }
1088717
protected function _valid_id($id) {
		$valid = false;
		switch($this->_identifier_type) {
			case 'integer':
				$valid = is_int($id) || (string)(int)$id == $id;
				break;
		}
		return $valid;
	}
752113
public function has($id)
    {
        if (!is_string($id)) {
            throw new ContainerException('$id must be a string');
        }

        if (array_key_exists($id, $this->definitions)) {
            return true;
        }

        return false;
    }
1259860
public function is_singleton( $id ) {
		if ( ! is_string( $id ) ) {
			throw new InvalidArgumentException( 'Invalid argument. Must be string.' );
		}

		if ( ! $this->bound( $id ) ) {
			return false;
		}

		$id = $this->get_class_prefix( $id );

		return $this->bindings[$id]['singleton'] === true;
	}
1320540
public function checkPreviousValidToken($id, $text = false) {
		$token = $this->peekPrvsValidToken();
		return $this->checkToken($token, $id, $text);
	}
920490
public function providerHas(/*# string */ $id)/*# : bool */
    {
        foreach ($this->providers as $provider) {
            if ($provider->has($id)) {
                return true;
            }
        }
        return false;
    }
369649
public function deleteByStringId(string $id, string $key = null): int
    {
        return $this->deleteByKey($id, $key);
    }
1284062
protected function isSingelton($id)
    {
        return (isset($this->binds[$id]['singleton']) && $this->binds[$id]['singleton'] === true);
    }
149137
public static function isTicketOwner($id)
    {
        if (auth()->check()) {
            if (auth()->user()->id == Ticket::find($id)->user->id) {
                return true;
            }
        }
    }
712612
public function recordExists($id)
    {
        if (is_object($id)) {
            return true;
        }
        if (is_numeric($id) or $this->shouldBeNumber($id)) {
            return $this->findById($id, true);
        }
        if (is_string($id)) {
            return $this->findByIdentifier($id, true);
        }
    }
1145234
protected function isCachedByString($string, int $siteId = null)
    {

        // Resolve siteId
        $siteId = SiteHelper::resolveSiteId($siteId);

        if (!isset($this->cacheByString[$siteId])) {
            $this->cacheByString[$siteId] = [];
        }

        return array_key_exists($string, $this->cacheByString[$siteId]);
    }
1053072
public function has($string)
    {
        $lowercase = strtolower($string);

        if (!parent::has($lowercase) && !JFactory::getLanguage()->hasKey($string))
        {
            if (isset($this->_aliases[$lowercase])) {
                $key = $this->_aliases[$lowercase];
            }
            elseif (substr($string, 0, strlen($this->getPrefix())) === $this->getPrefix()) {
                $key = $string;
            } else {
                //Gets a key from the catalogue and prefixes it
                $key = $this->getPrefix().$this->generateKey($string);
            }

            $result = JFactory::getLanguage()->hasKey($key);
        }
        else $result = true;

        return $result;
    }
1012359
public static function has($id)
    {
        $instance = self::getInstance();
        $file = $instance->_file($id);

        if (!is_file($file)) {
            return false;
        }
        return true;
    }
721532
public function has($id)
    {
        $id = strtolower($id);

        return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
    }
239775
public function delete(string $id): bool
    {
        if (\array_key_exists($id, $this->cache)) {

            //delete value
            unset($this->cache[$id]);

            //return function result
            return true;
        }

        return false;
    }