HttpSourceEndpoint

Extends \HttpSourceConfigFactoryItem

Http source endpoint

package

HttpSource

subpackage

Config

Methods

Constructor

__construct(\HttpSourceConfigFactory $ConfigFactory) 
inherited

Arguments

$ConfigFactory

\HttpSourceConfigFactory

Config factory instance

Buils query parameters

_buildQuery(\Model $model, array $usedConditions, array $queryData) 

Arguments

$model

\Model

$usedConditions

array

List of conditions that must present in query

$queryData

array

Query data: conditions, limit, etc

If true conditions by default will be sent in query, otherwize in body

_mustSendInQuery(\Model $model) : boolean

Arguments

$model

\Model

Response

boolean

Apply renaming and callbacks to items

_process(array $items, array $storage, \Model $model) : array

Arguments

$items

array

$storage

array

$model

\Model

Response

array

Process conditions mappings as set by condition->map() method

_processConditions(\Model $model, array &$conditions) 

Arguments

$model

\Model

$conditions

array

Process read parameters. Eq: map limit parameter to some condition

_processReadParams(\Model $model, array &$params) 

Arguments

$model

\Model

$params

array

Add new conditions

addCondition(\HttpSourceCondition $Condition) : \HttpSourceEndpoint

Arguments

Response

\HttpSourceEndpoint

Add new field

addField(\HttpSourceField $Field) : \HttpSourceEndpoint

Arguments

Response

\HttpSourceEndpoint

Build request and store it in model->request

buildRequest(\Model $model, array $queryData) 

Arguments

$model

\Model

$queryData

array

Set or get endpoint cache name

cacheName(string $name = null) : \HttpSourceEndpoint

Arguments

$name

string

Response

\HttpSourceEndpoint

Get condition by name, if condition not exists create, add and return new

condition(string $name) : \HttpSourceCondition

Arguments

$name

string

Response

\HttpSourceCondition

Returns associative list of default condition names and values

conditionsDefaults() : array

Response

array

Get field by name, if field not exists create, add and return new

field(string $name) : \HttpSourceCondition

Arguments

$name

string

Response

\HttpSourceCondition

Retunrn config factory

getConfigFactory() : \HttpSourceConfigFactory
inherited

Set or get endpoint id

id(integer $id = null) : \HttpSourceEndpoint
deprecated

Arguments

$id

integer

Response

\HttpSourceEndpoint

Get endpoint method

method() : \HttpSourceEndpoint

Set endpoint method to 'check'

methodCheck() : \HttpSourceEndpoint

Set endpoint method to 'create'

methodCreate() : \HttpSourceEndpoint

Set endpoint method to 'delete'

methodDelete() : \HttpSourceEndpoint

Set endpoint method to 'read'

methodRead() : \HttpSourceEndpoint

Set endpoint method to 'update'

methodUpdate() : \HttpSourceEndpoint

Returns list of optional condition names

optionalConditions() : array

Response

array

Set or get endpoint path

path(string $name = null) : \HttpSourceEndpoint

Arguments

$name

string

Response

\HttpSourceEndpoint

Process field mappings as set by field->map() method

processFields(\Model $model, array &$results) 

Arguments

$model

\Model

$results

array

Process results with result handler

processResult(\Model $model, array &$result) 

Arguments

$model

\Model

$result

array

Set or get endpoint query builder instead of _buildQuery

queryBuilder(callable $queryBuilder = null) : \HttpSourceEndpoint

Arguments

$queryBuilder

callable

Response

\HttpSourceEndpoint

Set or get endpoint mapped read param

readParams(array $params = null) : \HttpSourceEndpoint

Arguments

$params

array

Response

\HttpSourceEndpoint

Set or get endpoint request splitter

requestSplitter(callable $requestSplitter = null) : \HttpSourceEndpoint

Arguments

$requestSplitter

callable

Response

\HttpSourceEndpoint

Returns list of required condition names

requiredConditions() : array

Response

array

Set or get endpoint response joiner

responseJoiner(callable $responseJoiner = null) : \HttpSourceEndpoint

Arguments

$responseJoiner

callable

Response

\HttpSourceEndpoint

Set or get endpoint result handler

result(\HttpSourceResult $Result = null) : \HttpSourceEndpoint

Arguments

Response

\HttpSourceEndpoint

Build schema array to describe endpoint

schema() : array

Response

array

Set or get endpoint table

table(string $name = null) : \HttpSourceEndpoint

Arguments

$name

string

Response

\HttpSourceEndpoint

Constants

CRUD constants

METHOD_READ

METHOD_CREATE

METHOD_CREATE

METHOD_UPDATE

METHOD_UPDATE

METHOD_DELETE

METHOD_DELETE

METHOD_CHECK

METHOD_CHECK

Properties

Endpoint CRUD method

_method : string
var

Type(s)

string

Table name

_table : string
var

Type(s)

string

Endpoint path

_path : string
var

Type(s)

string

Endpoint fields

_fields : array
var

Type(s)

array

Endpoint conditions

_conditions : array
var

Type(s)

array

Endpoint result handler

_result : \HttpSourceResult
var

Type(s)

\HttpSourceResult

Mapped read params (limit, offset, etc)

_readParams : array
var

Type(s)

array

Endpoint id

_id : integer
var

Type(s)

integer

Function for splitting request

_requestSplitter : callable
var

Type(s)

callable

Function to join results of splitted requests

_responseJoiner : callable
var

Type(s)

callable

Function to build query instead of _buildQuery

_queryBuilder : callable
var

Type(s)

callable

Cache name for store requests. If null cache not used.

_cacheName : string

Cache works only for read method This setting will override global cache from config

var

Type(s)

string

Config factory instance

_ConfigFactory : \HttpSourceConfigFactory
inherited