PHP RestApi
REST is an acronym for REpresentational State Transfer and an architectural style for distributed hypermedia systems.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Samy\SimpleApi\ResponseInterface Interface Reference
Inheritance diagram for Samy\SimpleApi\ResponseInterface:
Samy\SimpleApi\Response

Public Member Functions

 isSuccess ()
 
 withSuccess (bool $Success)
 
 getData ()
 
 withData (mixed $Data)
 
 getMessages ()
 
 addMessage (string $Type, string $Text, mixed $Data=null)
 
 cleanMessages ()
 
 hasLink (string $Name)
 
 getLinks ()
 
 getLink (string $Name, string $Default="")
 
 withLink (string $Name, string $Url)
 
 withoutLink (string $Name)
 
 cleanLinks ()
 
 getError ()
 
 withError (string $Error)
 
 getErrorDescription ()
 
 withErrorDescription (string $ErrorDescription)
 
 getErrorUri ()
 
 withErrorUri (string $ErrorUri)
 

Detailed Description

Describes SimpleApi Response interface.

Member Function Documentation

◆ addMessage()

Samy\SimpleApi\ResponseInterface::addMessage ( string  $Type,
string  $Text,
mixed  $Data = null 
)

Return an instance with added message.

Parameters
[in]string$TypeMessage type
[in]string$TextMessage text
[in]mixed$DataMessage data
Returns
static

Implemented in Samy\SimpleApi\Response.

◆ cleanLinks()

Samy\SimpleApi\ResponseInterface::cleanLinks ( )

Return an instance without any link.

Returns
static

Implemented in Samy\SimpleApi\Response.

◆ cleanMessages()

Samy\SimpleApi\ResponseInterface::cleanMessages ( )

Return an instance without any messages.

Returns
static

Implemented in Samy\SimpleApi\Response.

◆ getData()

Samy\SimpleApi\ResponseInterface::getData ( )

Retrieve provided data.

Returns
mixed

Implemented in Samy\SimpleApi\Response.

◆ getError()

Samy\SimpleApi\ResponseInterface::getError ( )

Retrieve provided error parameter

Returns
string

◆ getErrorDescription()

Samy\SimpleApi\ResponseInterface::getErrorDescription ( )

Retrieve provided error description.

Returns
string

◆ getErrorUri()

Samy\SimpleApi\ResponseInterface::getErrorUri ( )

Retrieve provided error uri.

Returns
string

◆ getLink()

Samy\SimpleApi\ResponseInterface::getLink ( string  $Name,
string  $Default = "" 
)

Retrieve a link url by the given case-insensitive name.

Parameters
[in]string$NameLink name
[in]string$DefaultLink default if not exists
Returns
string

Implemented in Samy\SimpleApi\Response.

◆ getLinks()

Samy\SimpleApi\ResponseInterface::getLinks ( )

Retrieve all provided links.

Returns
array<string, string>

Implemented in Samy\SimpleApi\Response.

◆ getMessages()

Samy\SimpleApi\ResponseInterface::getMessages ( )

Retrieve all provided messages.

Returns
array<array<string, mixed>>

Implemented in Samy\SimpleApi\Response.

◆ hasLink()

Samy\SimpleApi\ResponseInterface::hasLink ( string  $Name)

Checks if a link exists by the given case-insensitive name.

Parameters
[in]string$NameLink name
Returns
bool

Implemented in Samy\SimpleApi\Response.

◆ isSuccess()

Samy\SimpleApi\ResponseInterface::isSuccess ( )

Retrieve provided success status.

Returns
bool

Implemented in Samy\SimpleApi\Response.

◆ withData()

Samy\SimpleApi\ResponseInterface::withData ( mixed  $Data)

Return an instance with provided data.

Parameters
[in]mixed$DataData
Returns
static

Implemented in Samy\SimpleApi\Response.

◆ withError()

Samy\SimpleApi\ResponseInterface::withError ( string  $Error)

Return an instance with error parameter.

Parameters
[in]string$ErrorError parameter.
Returns
static

◆ withErrorDescription()

Samy\SimpleApi\ResponseInterface::withErrorDescription ( string  $ErrorDescription)

Return an instance with error description.

Parameters
[in]string$ErrorDescriptionError description.
Returns
static

◆ withErrorUri()

Samy\SimpleApi\ResponseInterface::withErrorUri ( string  $ErrorUri)

Return an instance with error uri.

Parameters
[in]string$ErrorUriError uri.
Returns
static

◆ withLink()

Samy\SimpleApi\ResponseInterface::withLink ( string  $Name,
string  $Url 
)

Return an instance with the specified link.

Parameters
[in]string$NameLink name
[in]string$UrlLink valid url
Returns
static

Implemented in Samy\SimpleApi\Response.

◆ withoutLink()

Samy\SimpleApi\ResponseInterface::withoutLink ( string  $Name)

Return an instance without the specified link.

Parameters
[in]string$NameLink name
Returns
static

Implemented in Samy\SimpleApi\Response.

◆ withSuccess()

Samy\SimpleApi\ResponseInterface::withSuccess ( bool  $Success)

Return an instance with provided success status.

Parameters
[in]bool$SuccessSuccess status
Returns
static

Implemented in Samy\SimpleApi\Response.


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