Returns ResourceMetadata for the specified resource.

@param  string                                     $resourceName
@throws \BedRest\Resource\Mapping\Exception
@return \BedRest\Resource\Mapping\ResourceMetadata
502265
public function getMetadataByResourceName($resourceName)
    {
        $this->getAllMetadata();

        if (!isset($this->resourceClassMap[$resourceName])) {
            throw Exception::resourceNotFound($resourceName);
        }

        return $this->loadedMetadata[$this->resourceClassMap[$resourceName]];
    }
1038511
protected function getPartialSource($partialName)
    {
        $partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
        $partialSource = Files::getFileContents($partialPathAndFilename, FILE_TEXT);
        if ($partialSource === false) {
            throw new Exception\InvalidTemplateResourceException('"' . $partialPathAndFilename . '" is not a valid template resource URI.', 1257246929);
        }
        return $partialSource;
    }
315824
public function resourceConfigurationFor($resourceName)
    {
        foreach ($this->resourceConfigurations as $config) {
            if ($config->getResource() === $resourceName) {
                return $config;
            }
        }

        return null;
    }
1127845
public function getTable($tableName)
    {
        if (is_array($tableName)) {
            list($tableName, $entitySuffix) = $tableName;
        } else {
            $entitySuffix = null;
        }

        if ($entitySuffix !== null) {
            $tableName .= '_' . $entitySuffix;
        }

        if (!isset($this->_tables[$tableName])) {
            $this->_tables[$tableName] = $this->_resources->getTableName(
                $tableName,
                ResourceConnection::DEFAULT_CONNECTION
            );
        }

        return $this->_tables[$tableName];
    }
952848
public function resourceName()
    {
        if (!$this->_resourceName) {
            $this->_resourceName = str_replace('_', '-', $this->getTable());
        }
        return $this->_resourceName;
    }
1180034
public function getMetadataFor($className)
    {
        if (isset($this->mapping[$className])) {
            return $this->mapping[$className];
        }

        $metadata   = new ClassMetadata();
        $reflection = new ReflectionClass($className);

        $metadata->className      = $reflection->name;
        $metadata->riakProperties = $this->getRiakPropertiesMapping($reflection);

        return $this->mapping[$className] = $metadata;
    }
658011
protected function _getResourceName()
	{
		if( $this->_resourceName === null ) {
			$this->_resourceName = $this->_context->getConfig()->get( 'resource/default', 'db' );
		}

		return $this->_resourceName;
	}
597352
@Override
    public ManagedConnectionMetaData getMetaData() throws ResourceException {
        try {
            return new JcrManagedConnectionMetaData(mcf.getRepository(), session);
        } catch (Exception e) {
            throw new ResourceException(e);
        }
    }
42527
public function resource($name)
  {
      if (!isset($this->resources[$name])) {
          throw new Exceptions\ResourceException("Resource $name does not exist!");

          return;
      }

      return $this->resources[$name];
  }
246547
private function retrieveColumnsCachedMetadata($tableName)
    {
        $key = $this->cachePrefix . '.' . $tableName . '.meta';

        /* @noinspection PhpUnhandledExceptionInspection */
        return Cache::remember($key, function () use ($tableName) {
            return $this->retrieveColumnsMetadata($tableName);
        });
    }
1131827
private function getResourcesType(string $className): ?string
    {
        $resourceType = null;
        if (array_key_exists(ResourceAuthorizationRulesInterface::class, class_implements($className)) === true) {
            /** @var ResourceAuthorizationRulesInterface $className */
            $resourceType = $className::getResourcesType();
        }

        return $resourceType;
    }
678754
public function metadata($routeName)
	{
		return isset($this->_metadata[$routeName])
			? array_merge($this->_defaultMetadata, $this->_metadata[$routeName])
			: $this->_defaultMetadata
			;
	}
590119
private function getNamespaceFromResourceFilename(string $resourceFilename): string
  {
    $name = $this->getPathInResources($resourceFilename);

    // Remove resource dir from name.
    $len = strlen(trim($this->resourceDir, '/'));
    if ($len>0)
    {
      $name = substr($name, $len + 2);
    }

    // Remove extension.
    $parts = pathinfo($name);
    $name  = substr($name, 0, -(strlen($parts['extension']) + 1));

    return $name;
  }
1289571
protected function getResource()
    {
        if (empty($this->_resourceName) && empty($this->_resource)) {
            throw new LocalizedException(
                new Phrase('The resource isn\'t set.')
            );
        }

        return $this->_resource ?: ObjectManager::getInstance()->get($this->_resourceName);
    }
1104787
public function getProperty($propName)
    {
        if (self::isAttribute($propName)) {
            return $this->getAttribute($propName);
        } else {
            if ($getterName = $this->getterExists($propName)) {
                return $this->$getterName();
            } elseif (self::hasPublicProperty($propName)) {
                return $this->$propName;
            } else {
                throw new Exception\RuntimeException(
                    sprintf("Can't read unknown attribute '%s' for model %s", $propName, get_called_class())
                );
            }
        }
    }
738647
protected function getResourceInfo($fullPathName)
  {
    foreach ($this->resourceFilesInfo as $info)
    {
      if ($info['full_path_name']===$fullPathName)
      {
        return $info;
      }
    }

    $this->logError("Unknown resource file '%s'", $fullPathName);

    return null;
  }
796598
public function getDatabaseMetadata(string $databaseName): DatabaseMetadata
    {
        if (!array_key_exists($databaseName, $this->databaseMetadataList)) {
            throw new \RuntimeException('Server "' . $this->host . '" doesn\'t contain database "' . $databaseName . '"');
        }

        return $this->databaseMetadataList[$databaseName];
    }