Checks if the given resource exists in Transifex project

@param string $resource
@return bool
341392
public function resourceExists($resource)
    {
        $resources = $this->getAvailableResources();
        foreach ($resources as $res) {
            if ($res->slug == $resource) {
                return true;
            }
        }
        return false;
    }
69197
public function hasResource(ResourceInterface $otherResource) {
		if ($this->isEmpty()) {
			return false;
		}
		if ($this->type === RelationshipObject::TO_ONE) {
			return $this->resource->getResource()->equals($otherResource->getResource());
		}
		if ($this->type === RelationshipObject::TO_MANY) {
			foreach ($this->resources as $ownResource) {
				if ($ownResource->getResource()->equals($otherResource->getResource())) {
					return true;
				}
			}
		}
		
		return false;
	}
604985
public function isGranted($resource)
    {
        foreach ($this->roles as $role) {
            if (true === $role->hasResource($resource)) {
                return true;
            }
        }

        return false;
    }
298904
public function getCachePathForResource(string $resource)
    {
        if (!$this->cacheDir) {
            return false;
        }

        return str_replace($this->appDir, $this->cacheDir, $resource);
    }
256603
protected function _loadResource($resource) {
        return $this->cache([__METHOD__, $resource], function() use ($resource) {
            $data = $this->getLocaleBundle()->loadResource(null, $resource);

            if ($parent = $this->getParentLocale()) {
                $data = array_merge(
                    $parent->getLocaleBundle()->loadResource(null, $resource),
                    $data
                );
            }

            return $data;
        });
    }
242177
public function do_exists($key)
    {
        $redis = is_object($this->_redis) ? $this->_redis : $this->_getRedis();
        return (bool)$redis->exists($this->_prefix . $key);
    }
946653
public function exists(string $key): bool
    {
        $driver = $this->getDriver();
        $exists = $driver->get($key) !== null;
        if ($this->hasEventListeners('itemExists')) {
            $this->dispatchEvent('itemExists', new \BearFramework\App\Cache\ItemExistsEventDetails($key, $exists));
        }
        if ($this->hasEventListeners('itemRequest')) {
            $this->dispatchEvent('itemRequest', new \BearFramework\App\Cache\ItemRequestEventDetails($key));
        }
        return $exists;
    }
43527
public function supports($resource, $type = null)
    {
        try {
            $path = $this->locator->locate($resource);
        } catch (\Exception $e) {
            return false;
        }

        return 'module' === $type && is_string($resource) && is_dir($path);
    }
378210
public function hasFailedResource(ResourceNode $resource)
    {
        return !is_null($this->failedResourceIds) && in_array($resource->getId(), $this->failedResourceIds);
    }
149936
public function findSimilarResources(PersistentResource $resource)
    {
        $query = $this->createQuery();
        $query->matching(
            $query->logicalAnd(
                $query->equals('sha1', $resource->getSha1()),
                $query->equals('filename', $resource->getFilename()),
                $query->equals('collectionName', $resource->getCollectionName())
            )
        );
        return $query->execute();
    }
421373
public function checkAccess($action, $resource)
    {
        if ((is_null($resource) || is_null($resource->getId())) && (empty($action) || in_array(strtolower($action), array('list', 'create', 'post')))) {
            return true;
        }

        if (!is_null($resource)) {
            $query = $this->createQueryBuilder();
            $query->andWhere($query->getRootAliases()[0] . '.id = ' . $this->addNamedParameter('id', $resource, $query));
            $result = $this->getOneOrNullResultFromQueryBuilder($query);
            if ($result) {
                return true;
            } else {
                $this->throwException('Access for this resource has been denied', 'access-denied');
            }
        }
    }
654612
protected static function isKeyResource($resource): bool {
        if(!is_resource($resource)) {
            return FALSE;
        }
        if(get_resource_type($resource) != 'OpenSSL key') {
            return FALSE;
        }
        return TRUE;
    }
184060
public function isExportFileAction($resource, $action)
    {
        return isset($this->exportFileActions[$resource]) && in_array($action, $this->exportFileActions[$resource]);
    }
442632
protected function externalHandler(Resource $resource)
    {
        $handlers = $this->resources[$resource->name]['handlers'] ?? [];

        if (!empty($handlers)) {
            if ($this->safe_method) {
                $handlers = $handlers['GET'] ?? null;
                if (is_array($handlers)) {
                    $handlers = $this->getAvailableTypes($resource->name);
                    $type = $resource->content_type;
                }
            } else {
                $handlers = $handlers[$this->method] ?? null;
                if (is_array($handlers)) {
                    $type = $resource->payload['mime'];
                }
            }

            if (isset($type)) {
                $handler = $handlers[$type];
                if (is_array($handler)) {
                    $handler = $handler[$resource->kind];
                }
                if ($type === 'application/json' && $handler == '__DEFAULT__') {
                    $handler = null;
                }
            } else {
                $handler = $handlers;
            }

            if ($handler !== null) {
                if (is_callable($handler)) {
                    if ($this->method === 'HEAD') {
                        ob_start();
                        $handler($resource);
                        ob_end_clean();
                    } else {
                        $handler($resource);
                        flush();
                    }
                    return true;
                }
                $this->sendError(static::ERROR_INTERNAL_SERVER, sprintf(
                    "Resource '%s' has invalid %s handler: '%s' (%s request)",
                    $resource->name,
                    $this->method,
                    $handler,
                    $resource->kind
                ));
            }
        }

        return false;
    }
485595
public function setResource ($name, $resource)
	{
		
		// Get the resource
		
		$obj	=& Sonic::getResource ($resource);
		
		if (!$obj)
		{
			return FALSE;
		}
		
		// Set resource object
		
		$this->setResourceObj ($name, $obj);
		
		// Return
		
		return TRUE;
		
	}
366440
protected function hasError($resource)
    {
        // No error if no resource
        if (empty($resource)) {
            return false;
        }

        // If the error code is empty the statement / connection has not been run yet
        $code = $resource->errorCode();
        if (empty($code)) {
            return false;
        }

        // Skip 'ok' and undefined 'warning' types.
        // @see http://docstore.mik.ua/orelly/java-ent/jenut/ch08_06.htm
        return $code !== '00000' && $code !== '01000';
    }
843956
public function supports($resource, $type = null){
		$resolver = $this->getResolverForResource($resource, $type);
		return $resolver->resolve($resource, $type) !== false;
	}