PHP Class Zendesk\API\Resources\ResourceAbstract

Inheritance: use trait Zendesk\API\Traits\Utility\ChainedParametersTrait
Afficher le fichier Open project: zendesk/zendesk_api_client_php Class Usage Examples

Protected Properties

Свойство Type Description
$additionalRouteParams array
$apiBasePath string
$client Zendesk\API\HttpClient
$lastId integer
$objectName String
$objectNamePlural String
$resourceName String
$routes array

Méthodes publiques

Méthode Description
__construct ( HttpClient $client )
getAdditionalRouteParams ( ) : array
getLastId ( ) : integer Saves an id for future methods in the chain
getResourceName ( ) : String
getRoute ( $name, array $params = [] ) : mixed Returns a route and replaces tokenized parts of the string with the passed params
getRoutes ( ) : array Return all routes for this resource
getValidSubResources ( ) : array This returns the valid relations of this resource. Definition of what is allowed to chain after this resource.
hasAnyKey ( array $params, array $mandatory ) : boolean Check that any parameter has been supplied
hasKeys ( array $params, array $mandatory ) : boolean Check that all parameters have been supplied
setAdditionalRouteParams ( array $additionalRouteParams )
setLastId ( integer $id ) Saves an id for future methods in the chain
setRoute ( $name, $route ) Add or override an existing route
setRoutes ( array $routes ) Wrapper for adding multiple routes via setRoute
sideload ( array $fields = [] ) Enable side-loading (beta) - flags until the next chain

Méthodes protégées

Méthode Description
getResourceNameFromClass ( ) : string Return the resource name using the name of the class (used for endpoints)
setUpRoutes ( ) Sets up the available routes for the resource.

Method Details

__construct() public méthode

public __construct ( HttpClient $client )
$client Zendesk\API\HttpClient

getAdditionalRouteParams() public méthode

public getAdditionalRouteParams ( ) : array
Résultat array

getLastId() public méthode

Saves an id for future methods in the chain
public getLastId ( ) : integer
Résultat integer

getResourceName() public méthode

public getResourceName ( ) : String
Résultat String

getResourceNameFromClass() protected méthode

Return the resource name using the name of the class (used for endpoints)
protected getResourceNameFromClass ( ) : string
Résultat string

getRoute() public méthode

Returns a route and replaces tokenized parts of the string with the passed params
public getRoute ( $name, array $params = [] ) : mixed
$name
$params array
Résultat mixed

getRoutes() public méthode

Return all routes for this resource
public getRoutes ( ) : array
Résultat array

getValidSubResources() public static méthode

Make sure to add in this method when adding new sub resources. Example: $client->ticket()->comments(); Where ticket would have a comments as a valid sub resource. The array would look like: ['comments' => '\Zendesk\API\Resources\TicketComments']
public static getValidSubResources ( ) : array
Résultat array

hasAnyKey() public méthode

Check that any parameter has been supplied
public hasAnyKey ( array $params, array $mandatory ) : boolean
$params array
$mandatory array
Résultat boolean

hasKeys() public méthode

Check that all parameters have been supplied
public hasKeys ( array $params, array $mandatory ) : boolean
$params array
$mandatory array
Résultat boolean

setAdditionalRouteParams() public méthode

public setAdditionalRouteParams ( array $additionalRouteParams )
$additionalRouteParams array

setLastId() public méthode

Saves an id for future methods in the chain
public setLastId ( integer $id )
$id integer

setRoute() public méthode

Add or override an existing route
public setRoute ( $name, $route )
$name
$route

setRoutes() public méthode

Wrapper for adding multiple routes via setRoute
public setRoutes ( array $routes )
$routes array

setUpRoutes() protected méthode

Sets up the available routes for the resource.
protected setUpRoutes ( )

sideload() public méthode

Enable side-loading (beta) - flags until the next chain
public sideload ( array $fields = [] )
$fields array

Property Details

$additionalRouteParams protected_oe property

protected array $additionalRouteParams
Résultat array

$apiBasePath protected_oe property

protected string $apiBasePath
Résultat string

$client protected_oe property

protected HttpClient,Zendesk\API $client
Résultat Zendesk\API\HttpClient

$lastId protected_oe property

protected int $lastId
Résultat integer

$objectName protected_oe property

protected String $objectName
Résultat String

$objectNamePlural protected_oe property

protected String $objectNamePlural
Résultat String

$resourceName protected_oe property

protected String $resourceName
Résultat String

$routes protected_oe property

protected array $routes
Résultat array