Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ezpRestPrefixFilterInterface Class Reference
Inheritance diagram for ezpRestPrefixFilterInterface:

## Public Member Functions
| __construct (ezcMvcRequest $request, $apiPrefix)
| filter ()
| filterRequestUri ()

## Static Public Member Functions
static | getApiVersion ()
static | getApiProviderName ()
static | getApiPrefix ()

## Protected Member Functions
| parseVersionValue ()

## Protected Attributes
| $request
| $versionToken
| $apiProviderToken

## Static Protected Attributes
static | $version = null
static | $apiProvider = null
static | $apiPrefix = null

## Detailed Description

Definition at line 12 of file prefix_filter.php.

## Constructor & Destructor Documentation

## ◆ __construct()

ezpRestPrefixFilterInterface::__construct | ( | ezcMvcRequest | $request,
|  |  | $apiPrefix
| ) |  |
| abstract

Creates a new VersionToken object which describes the version token in API strings.

@abstract

Parameters

  ezcMvcRequest | $request |
  string | $apiPrefix | The API prefix of HTTP requests going to the REST interface.

Reimplemented in ezpRestDefaultRegexpPrefixFilter.

## Member Function Documentation

## ◆ filter()

ezpRestPrefixFilterInterface::filter | ( |  | ) |
| abstract

Filters the request object for API provider and version token.

The API provider is by default assumed to be the first URI element. Other custom implementations of this interface are free to choose otherwise.

If version token exists, gets the numerical value of this token, and filters the URI in the request object, removing said token.

This lets us not to deal with any version token data, in our route definitions. This is a benefit, since different systems, might have different preferences for what the version token should look like.

@abstract

Returns
  void

Reimplemented in ezpRestDefaultRegexpPrefixFilter.

## ◆ filterRequestUri()

ezpRestPrefixFilterInterface::filterRequestUri | ( |  | ) |

Filters the URI property of the given ezcMvcRequest object, removing any version token from it.

Returns
  void

Definition at line 128 of file prefix_filter.php.

References $apiProviderToken, and $versionToken.

## ◆ getApiPrefix()

static ezpRestPrefixFilterInterface::getApiPrefix | ( |  | ) |
| static

Returns a global API prefix

Returns
  false|string

Definition at line 113 of file prefix_filter.php.

References $apiPrefix.

Referenced by ezpRestVersionedRoute\generateUrl().

## ◆ getApiProviderName()

static ezpRestPrefixFilterInterface::getApiProviderName | ( |  | ) |
| static

Returns the name of the referenced API provider for the current query.

Returns
  false|string The identifier of the API provider used in this query.

Definition at line 98 of file prefix_filter.php.

References $apiProvider.

Referenced by ezpMvcConfiguration\createView(), ezpRestRouter\doCreateRoutes(), ezpRestMvcController\generateCacheId(), ezpRestVersionedRoute\generateUrl(), ezpRestRequest\getBaseURI(), ezpRestRouter\getCachedRoutes(), and ezpRestMvcController\getCacheLocation().

## ◆ getApiVersion()

static ezpRestPrefixFilterInterface::getApiVersion | ( |  | ) |
| static

Returns the version number of the API call.

If no version is found in the request, it defaults to '1'.

Returns
  int The version number of the API call.

Definition at line 83 of file prefix_filter.php.

References $version, and $version.

Referenced by ezpRestIniRouteFilter\checkRoute(), ezpRestMvcController\generateCacheId(), ezpRestMvcController\getCacheLocation(), and ezpRestVersionedRoute\matches().

## ◆ parseVersionValue()

ezpRestPrefixFilterInterface::parseVersionValue | ( |  | ) |
| abstract protected

Returns the numerical version of the version token.

@abstract

Returns
  int version value

Reimplemented in ezpRestDefaultRegexpPrefixFilter.

## Member Data Documentation

## ◆ $apiPrefix

ezpRestPrefixFilterInterface::$apiPrefix = null
| static protected

Definition at line 38 of file prefix_filter.php.

Referenced by ezpRestDefaultRegexpPrefixFilter\__construct(), and getApiPrefix().

## ◆ $apiProvider

ezpRestPrefixFilterInterface::$apiProvider = null
| static protected

Definition at line 33 of file prefix_filter.php.

Referenced by getApiProviderName().

## ◆ $apiProviderToken

ezpRestPrefixFilterInterface::$apiProviderToken
| protected

Definition at line 23 of file prefix_filter.php.

Referenced by ezpRestDefaultRegexpPrefixFilter\filter(), and filterRequestUri().

## ◆ $request

ezpRestPrefixFilterInterface::$request
| protected

Definition at line 14 of file prefix_filter.php.

Referenced by ezpRestDefaultRegexpPrefixFilter\__construct().

## ◆ $version

ezpRestPrefixFilterInterface::$version = null
| static protected

Definition at line 28 of file prefix_filter.php.

Referenced by getApiVersion().

## ◆ $versionToken

ezpRestPrefixFilterInterface::$versionToken
| protected

Definition at line 18 of file prefix_filter.php.

Referenced by filterRequestUri().

The documentation for this class was generated from the following file:

- prefix_filter.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.