Reference
C
Class

ApiPlatform\State\Pagination\Pagination

Pagination configuration.

class ApiPlatform\State\Pagination\Pagination
{
    public __construct(array $options, array $graphQlOptions)
    public getPage(array $context): int
    public getOffset(null|ApiPlatform\Metadata\Operation $operation, array $context): int
    public getLimit(null|ApiPlatform\Metadata\Operation $operation, array $context): int
    public getPagination(null|ApiPlatform\Metadata\Operation $operation, array $context): array
    public isEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
    public isGraphQlEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
    public isPartialEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
    public getOptions(): array
    public getGraphQlPaginationType(ApiPlatform\Metadata\Operation $operation): string
}
class ApiPlatform\State\Pagination\Pagination
{
    public __construct(array $options, array $graphQlOptions)
    public getPage(array $context): int
    public getOffset(null|ApiPlatform\Metadata\Operation $operation, array $context): int
    public getLimit(null|ApiPlatform\Metadata\Operation $operation, array $context): int
    public getPagination(null|ApiPlatform\Metadata\Operation $operation, array $context): array
    public isEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
    public isGraphQlEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
    public isPartialEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
    public getOptions(): array
    public getGraphQlPaginationType(ApiPlatform\Metadata\Operation $operation): string
}

Methods

__construct

public __construct(array $options, array $graphQlOptions)
public __construct(array $options, array $graphQlOptions)

Parameters

optionsarray
graphQlOptionsarray

getPage

Gets the current page.

public getPage(array $context): int
public getPage(array $context): int

Parameters

contextarray

Returns

int

getOffset

Gets the current offset.

public getOffset(null|ApiPlatform\Metadata\Operation $operation, array $context): int
public getOffset(null|ApiPlatform\Metadata\Operation $operation, array $context): int

Parameters

operationApiPlatform\Metadata\Operation
contextarray

Returns

int

getLimit

Gets the current limit.

public getLimit(null|ApiPlatform\Metadata\Operation $operation, array $context): int
public getLimit(null|ApiPlatform\Metadata\Operation $operation, array $context): int

Parameters

operationApiPlatform\Metadata\Operation
contextarray

Returns

int

getPagination

Gets info about the pagination.Returns an array with the following info as values:

public getPagination(null|ApiPlatform\Metadata\Operation $operation, array $context): array
public getPagination(null|ApiPlatform\Metadata\Operation $operation, array $context): array

Parameters

operationApiPlatform\Metadata\Operation
contextarray

Returns

array

isEnabled

Is the pagination enabled?

public isEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
public isEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool

Parameters

operationApiPlatform\Metadata\Operation
contextarray

Returns

bool

isGraphQlEnabled

Is the pagination enabled for GraphQL?

public isGraphQlEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
public isGraphQlEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool

Parameters

operationApiPlatform\Metadata\Operation
contextarray

Returns

bool

isPartialEnabled

Is the partial pagination enabled?

public isPartialEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool
public isPartialEnabled(null|ApiPlatform\Metadata\Operation $operation, array $context): bool

Parameters

operationApiPlatform\Metadata\Operation
contextarray

Returns

bool

getOptions

public getOptions(): array
public getOptions(): array

Returns

array

getGraphQlPaginationType

public getGraphQlPaginationType(ApiPlatform\Metadata\Operation $operation): string
public getGraphQlPaginationType(ApiPlatform\Metadata\Operation $operation): string

Parameters

operationApiPlatform\Metadata\Operation

Returns

string

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop