PHP Class Elastica\Request

Author: Nicolas Ruflin ([email protected])
Inheritance: extends Param
Datei anzeigen Open project: ruflin/elastica Class Usage Examples

Protected Properties

Property Type Description
$_connection Connection

Public Methods

Method Description
__construct ( string $path, string $method = self::GET, array $data = [], array $query = [], Connection $connection = null ) : Request Construct.
__toString ( ) : string
getConnection ( ) : Connection Return Connection Object.
getData ( ) : array Return request data.
getMethod ( ) : string Get request method.
getPath ( ) : string Return request path.
getQuery ( ) : array Return query params.
send ( ) : Response Sends request to server.
setConnection ( Connection $connection )
setData ( array $data ) Sets the request data.
setMethod ( string $method ) Sets the request method. Use one of the for consts.
setPath ( string $path ) Sets the request path.
setQuery ( array $query = [] )
toArray ( ) : array
toString ( ) : string Converts request to curl request format.

Method Details

__construct() public method

Construct.
public __construct ( string $path, string $method = self::GET, array $data = [], array $query = [], Connection $connection = null ) : Request
$path string Request path
$method string OPTIONAL Request method (use const's) (default = self::GET)
$data array OPTIONAL Data array
$query array OPTIONAL Query params
$connection Connection
return Request OPTIONAL Connection object

__toString() public method

public __toString ( ) : string
return string

getConnection() public method

Return Connection Object.
public getConnection ( ) : Connection
return Connection

getData() public method

Return request data.
public getData ( ) : array
return array Request data

getMethod() public method

Get request method.
public getMethod ( ) : string
return string Request method

getPath() public method

Return request path.
public getPath ( ) : string
return string Request path

getQuery() public method

Return query params.
public getQuery ( ) : array
return array Query params

send() public method

Sends request to server.
public send ( ) : Response
return Response Response object

setConnection() public method

public setConnection ( Connection $connection )
$connection Connection

setData() public method

Sets the request data.
public setData ( array $data )
$data array Request data

setMethod() public method

Sets the request method. Use one of the for consts.
public setMethod ( string $method )
$method string Request method

setPath() public method

Sets the request path.
public setPath ( string $path )
$path string Request path

setQuery() public method

public setQuery ( array $query = [] )
$query array

toArray() public method

public toArray ( ) : array
return array

toString() public method

Converts request to curl request format.
public toString ( ) : string
return string

Property Details

$_connection protected_oe property

protected Connection,Elastica $_connection
return Connection