PHP Интерфейс Webiny\Component\Rest\Interfaces\VersionInterface

The interfaces must be only implemented on the class that your are sending to: Rest::registerClass method. Other versions don't need to implement the interface, since from the main class we can get to all of the versions, and it's easier for you to maintain one file.
Показать файл Открыть проект

Открытые методы

Метод Описание
getAllVersions ( ) : array Returns a list of all version, where the key is the version, and value is the namespace.
getCurrentVersion ( ) : string Returns the current api version. For example, you might have the latest version in a "beta" state, so you wish to keep your users using the latest stable versions.
getLatestVersion ( ) : string Returns the latest (highest) available api version.

Описание методов

getAllVersions() публичный статический Метод

Example: [ '1.0' => 'MyApp/Apis/Cms/Page/V1x1/', '1.2' => 'MyApp/Apis/Cms/Page/V1x2/', '2.0' => 'MyApp/Apis/Cms/Page/', ] How you organize your namespace is up to you.
public static getAllVersions ( ) : array
Результат array

getCurrentVersion() публичный статический Метод

Users can still access the latest version if the specify the latest version number or "latest" as a version name in the X-Webiny-Rest-Version header. Version should be in format of A.B, for example: 1.1
public static getCurrentVersion ( ) : string
Результат string

getLatestVersion() публичный статический Метод

Version should be in format of A.B, for example: 1.1
public static getLatestVersion ( ) : string
Результат string