Returns the resource event name.

@param ResourceInterface $resource
@param string            $suffix

@return string|null
193605
public function getResourceEventName(ResourceInterface $resource, $suffix)
    {
        if (null !== $configuration = $this->registry->findConfiguration($resource, false)) {
            return sprintf('%s.%s', $configuration->getResourceId(), $suffix);
        }

        // TODO throw exception ?

        return null;
    }
704481
public function getResolverForResource($resource, $type = null){
		if(is_string($resource) && $resource[0] === '/'){
			$dir = dirname($resource);
			$resolver = $this->getResolverForPath($dir);
		}else{
			$resolver = $this->getResolver();
		}
		return $resolver;
	}
998228
public function getPathByConvention($suffix = null)
    {
        $entityName = strtolower($this->getEntityName());
        $entityName = str_replace('\\', '_', $entityName);
        if (empty($suffix)) {
            return sprintf('%s_admin_%s', strtolower($this->getBundleName()), $entityName);
        }

        return sprintf('%s_admin_%s_%s', strtolower($this->getBundleName()), $entityName, $suffix);
    }
633345
public function getForResource($resource)
    {
        $resourceName = $this->resourceName($resource);

        if (isset($this->resourceFactories[$resourceName])) {
            return $this->resourceFactories[$resourceName];
        }

        throw new HandlerNotFoundException("No handler found for resource '$resourceName'");

    }
1015336
public function update(ResourceInterface $resource)
    {
        $event = $this->createResourceEvent($resource);
        $this->dispatcher->dispatch($this->config->getEventName('pre_update'), $event);

        if (!$event->isPropagationStopped()) {
            $this->persistResource($event);

            $this->dispatcher->dispatch($this->config->getEventName('post_update'), $event);
        }

        return $event;
    }
257104
public function getId($suffix = null)
    {
        $id = class_basename(get_called_class()) . '-' . $this->action;
        if ($suffix !== null) {
            $id .= '-' . $suffix;
        }

        return $id;
    }
1341555
public function getWebPathForResource(Resource $resource)
    {
        $relPath = Path::makeRelative($resource->getRepositoryPath(), $this->basePath);

        return '/'.trim($this->mapping->getWebPath().'/'.$relPath, '/');
    }
1167642
public function getResourceName()
    {
        return $this->name !== null ? $this->name : str_replace('_', '-', (new Inflector())->tableize($this->getManager()->getName()));
    }
336695
public static function getClassShortName(
        string $class,
        string $suffix = ''
    ): string {
        $baseName = static::getClassBaseName($class);

        return preg_replace(sprintf('/%s$/', $suffix), '', $baseName);
    }
410795
public function setResource(ResourceInterface $resource = null)
    {
        $this->resource = $resource;

        // Clear urls
        $this->urls = null;

        return $this;
    }
1111094
private function getClassMetadata(ResourceInterface $resource)
    {
        $entityClass = $resource->getEntityClass();

        return $this
            ->managerRegistry
            ->getManagerForClass($entityClass)
            ->getClassMetadata($entityClass)
        ;
    }
475516
protected function getResourceAction($resource, $controller, $method, $options)
    {
        $name = $this->getResourceName($resource, $method, $options);

        return array('as' => $name, 'uses' => $controller .'@' .$method);
    }
989703
public function getTemplatesWithSuffix($suffix)
    {
        $templates = SSViewer::get_templates_by_class(get_class($this), $suffix, __CLASS__);
        return SSViewer::chooseTemplate($templates);
    }
1269374
private function resourceToString(string $resource): string
    {
        if ($this->loaded[$resource] ?? false) {
            return '';
        }

        $this->loaded[$resource] = true;

        $format = $this->getExtension($resource);
        $ret    = '';

        switch ($format) {
            case 'css':
                $ret .= "<link rel='stylesheet' href='$resource'>";
                break;
            case 'js':
                $ret .= "<script src='$resource'></script>";
                break;
            default:
                $ret .= $this->getCode($resource);
        }

        return $ret;
    }
683794
public function getNewPath($suffix = '')
    {
        $result = $this->getPath().'/'.$this->uniqueCounter.(string) $suffix;
        ++$this->uniqueCounter;

        return $result;
    }
722602
protected function getGroupResourceName($prefix, $resource, $method)
    {
        $availableLocales = $this->languageRepository->availableLocales();

        // Remove segments from group prefix that are equal to one of the available locales:
        $groupSegments = explode('/', $this->router->getLastGroupPrefix());
        $groupSegments = array_filter($groupSegments, function ($segment) use ($availableLocales) {
            return !in_array($segment, $availableLocales);
        });
        $group = trim(implode('.', $groupSegments), '.');

        if (empty($group)) {
            return trim("{$prefix}{$resource}.{$method}", '.');
        }

        return trim("{$prefix}{$group}.{$resource}.{$method}", '.');
    }
1152461
protected function createResourceEvent($resource)
    {
        if (null !== $eventClass = $this->config->getEventClass()) {
            $event = new $eventClass($resource);
        } else {
            $event = new ResourceEvent();
            $event->setResource($resource);
        }
        return $event;
    }