ApiPlatform\Core\PathResolver\UnderscoreOperationPathResolver::resolveOperationPath PHP Method

resolveOperationPath() public method

public resolveOperationPath ( string $resourceShortName, array $operation, boolean $collection ) : string
$resourceShortName string
$operation array
$collection boolean
return string
    public function resolveOperationPath(string $resourceShortName, array $operation, bool $collection) : string
    {
        $path = '/' . Inflector::pluralize(Inflector::tableize($resourceShortName));
        if (!$collection) {
            $path .= '/{id}';
        }
        $path .= '.{_format}';
        return $path;
    }

Usage Example

 public function testResolveCollectionOperationPath()
 {
     $underscoreOperationPathResolver = new UnderscoreOperationPathResolver();
     $this->assertSame('/short_names.{_format}', $underscoreOperationPathResolver->resolveOperationPath('ShortName', [], true));
 }
UnderscoreOperationPathResolver