PHP Trait Zendesk\API\Traits\Utility\ChainedParametersTrait

An example would be a call $client->ticket(2)->comments(3)->author(); would create an Author object with chained parameters (An Array): [ 'Zendesk\API\Tickets' => 2, 'Zendesk\API\Comments' => 3 ]
显示文件 Open project: zendesk/zendesk_api_client_php

Protected Properties

Property Type Description
$chainedParameters array

Public Methods

Method Description
addChainedParametersToParams ( array $params, array $map ) : array A helper method to add the chained parameters to the existing parameters.
getChainedParameter ( $name, null $default = null ) Returns the named chained parameter
getChainedParameters ( ) : array Returns chained parameters
getLatestChainedParameter ( array $excludes = [] ) : array Returns the named chained parameter
setChainedParameters ( $params ) Sets the chained parameters

Method Details

addChainedParametersToParams() public method

A helper method to add the chained parameters to the existing parameters.
public addChainedParametersToParams ( array $params, array $map ) : array
$params array The existing parameters
$map array An array describing what parameter key corresponds to which classId e.g. ['ticket_id' => 'Zendesk\API\Ticket'] normal usage would be ['id' => $this::class]
return array

getChainedParameter() public method

Returns the named chained parameter
public getChainedParameter ( $name, null $default = null )
$name
$default null

getChainedParameters() public method

Returns chained parameters
public getChainedParameters ( ) : array
return array

getLatestChainedParameter() public method

Returns the named chained parameter
public getLatestChainedParameter ( array $excludes = [] ) : array
$excludes array Pass an array of classnames to exclude from query
return array

setChainedParameters() public method

Sets the chained parameters
public setChainedParameters ( $params )
$params

Property Details

$chainedParameters protected_oe property

protected array $chainedParameters
return array