RedirectRepository
class \
Class for accessing redirect records from the database
Internal
Table of Contents
Methods
- __construct() : mixed
- countActiveRedirects() : int
- countRedirectsByDemand() : int
- findCreationTypes() : array
- Get all used creation types
- findCreators() : array<int, array<string, mixed>>
- Get the backend users, which created at least one redirect, as a map of their uid and their be_users record. Redirects without a tracked creator are mapped to the "0" key. Deleted backend users are not resolved, so an empty record means the user is either untracked or gone, leaving it to the consumer to label those cases.
- findHostsOfRedirects() : array
- Get all used hosts
- findIntegrityStatusCodes() : array
- Get all used integrity status codes
- findRedirectsByDemand() : array
- Used within the backend module, which also includes the hidden records, but never deleted records.
- findRedirectsToRemoveByDemand() : array<int, array<string, mixed>>
- Returns all redirects which would be removed by removeByDemand() for the given demand, which allows previewing a cleanup, for example in a dry run of the "redirects:cleanup" command.
- findRedirectTypes() : array
- Get all available redirect_types
- findStatusCodesOfRedirects() : array
- Get all used status codes
- removeByDemand() : void
- addSourceHostConstraint() : void
- Adds source host constraint to query for non-admin users This significantly reduces the dataset before PHP filtering
- getBackendUser() : BackendUserAuthentication
- getGroupedRows() : array<int, array<string, scalar|null>>
- getQueryBuilder() : QueryBuilder
- getQueryBuilderForDemand() : QueryBuilder
- Prepares the QueryBuilder with Constraints from the Demand
- sortOutInaccessibleRedirects() : array<int, array<string|int, mixed>>
Methods
__construct()
public
__construct(TcaSchemaFactory $schemaFactory, RedirectPermissionGuard $redirectPermissionGuard, ConnectionPool $connectionPool) : mixed
Parameters
- $schemaFactory : TcaSchemaFactory
- $redirectPermissionGuard : RedirectPermissionGuard
- $connectionPool : ConnectionPool
countActiveRedirects()
public
countActiveRedirects() : int
Return values
intcountRedirectsByDemand()
public
countRedirectsByDemand(Demand $demand) : int
Parameters
- $demand : Demand
Return values
intfindCreationTypes()
Get all used creation types
public
findCreationTypes([string|null $type = null ]) : array
Parameters
- $type : string|null = null
Return values
arrayfindCreators()
Get the backend users, which created at least one redirect, as a map of their uid and their be_users record. Redirects without a tracked creator are mapped to the "0" key. Deleted backend users are not resolved, so an empty record means the user is either untracked or gone, leaving it to the consumer to label those cases.
public
findCreators([string|null $type = null ]) : array<int, array<string, mixed>>
Parameters
- $type : string|null = null
Return values
array<int, array<string, mixed>>findHostsOfRedirects()
Get all used hosts
public
findHostsOfRedirects([string|null $type = null ]) : array
Parameters
- $type : string|null = null
Return values
arrayfindIntegrityStatusCodes()
Get all used integrity status codes
public
findIntegrityStatusCodes([string|null $type = null ]) : array
Parameters
- $type : string|null = null
Return values
arrayfindRedirectsByDemand()
Used within the backend module, which also includes the hidden records, but never deleted records.
public
findRedirectsByDemand(Demand $demand) : array
Parameters
- $demand : Demand
Return values
arrayfindRedirectsToRemoveByDemand()
Returns all redirects which would be removed by removeByDemand() for the given demand, which allows previewing a cleanup, for example in a dry run of the "redirects:cleanup" command.
public
findRedirectsToRemoveByDemand(Demand $demand) : array<int, array<string, mixed>>
Parameters
- $demand : Demand
Return values
array<int, array<string, mixed>>findRedirectTypes()
Get all available redirect_types
public
findRedirectTypes() : array
Return values
arrayfindStatusCodesOfRedirects()
Get all used status codes
public
findStatusCodesOfRedirects([string|null $type = null ]) : array
Parameters
- $type : string|null = null
Return values
arrayremoveByDemand()
public
removeByDemand(Demand $demand) : void
Parameters
- $demand : Demand
addSourceHostConstraint()
Adds source host constraint to query for non-admin users This significantly reduces the dataset before PHP filtering
protected
addSourceHostConstraint(QueryBuilder $queryBuilder) : void
Parameters
- $queryBuilder : QueryBuilder
Tags
getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetGroupedRows()
protected
getGroupedRows(string $field, string $as[, string|null $type = 'default' ]) : array<int, array<string, scalar|null>>
Parameters
- $field : string
- $as : string
- $type : string|null = 'default'
Return values
array<int, array<string, scalar|null>>getQueryBuilder()
protected
getQueryBuilder() : QueryBuilder
Return values
QueryBuildergetQueryBuilderForDemand()
Prepares the QueryBuilder with Constraints from the Demand
protected
getQueryBuilderForDemand(Demand $demand[, bool $createCountQuery = false ]) : QueryBuilder
Parameters
- $demand : Demand
- $createCountQuery : bool = false
Return values
QueryBuildersortOutInaccessibleRedirects()
protected
sortOutInaccessibleRedirects(array<int, array<string|int, mixed>> $redirects) : array<int, array<string|int, mixed>>
Parameters
- $redirects : array<int, array<string|int, mixed>>