PHP Class lithium\data\source\Http

Inheritance: extends lithium\data\Source
Afficher le fichier Open project: unionofrad/lithium Class Usage Examples

Méthodes publiques

Свойство Type Description
$connection Service connection

Protected Properties

Свойство Type Description
$_autoConfig array The set of array keys which will be auto-populated in the object's protected properties from constructor parameters.
$_classes array Fully-namespaced class references
$_isConnected boolean Is Connected?
$_methods array List of methods and their corresponding HTTP method and path.

Méthodes publiques

Méthode Description
__call ( string $method, array $params ) : mixed Pass methods to service connection. Path and method are determined from Http::$_method. If not set, a GET request with the $method as the path will be used.
__construct ( array $config = [] ) : void Constructor.
__get ( string $property ) : mixed Pass properties to service connection
connect ( ) : boolean Fake the connection since service is called for every method.
create ( object $query, array $options = [] ) : mixed Create function used to POST.
delete ( object $query, array $options = [] ) : string Used by model to DELETE.
describe ( string $entity, array $fields = [], array $meta = [] ) : array Describe data source.
disconnect ( ) : boolean Disconnect from socket.
read ( object $query, array $options = [] ) : string Read used by model to GET.
relationship ( string $class, string $type, string $name, array $options = [] ) : array Defines or modifies the default settings of a relationship between two models.
respondsTo ( string $method, boolean $internal = false ) : boolean Determines if a given method can be called.
send ( array $query = null, array $options = [] ) : mixed Method to send to a specific resource.
sources ( object $class = null ) : array Returns available data sources (typically a list of REST resources collections).
update ( object $query, array $options = [] ) : string Update used by model to PUT.

Méthodes protégées

Méthode Description
_init ( )

Method Details

__call() public méthode

Pass methods to service connection. Path and method are determined from Http::$_method. If not set, a GET request with the $method as the path will be used.
See also: lithium\data\source\Http::$_method
public __call ( string $method, array $params ) : mixed
$method string
$params array
Résultat mixed

__construct() public méthode

Constructor.
public __construct ( array $config = [] ) : void
$config array
Résultat void

__get() public méthode

Pass properties to service connection
public __get ( string $property ) : mixed
$property string
Résultat mixed

_init() protected méthode

protected _init ( )

connect() public méthode

Fake the connection since service is called for every method.
public connect ( ) : boolean
Résultat boolean

create() public méthode

Create function used to POST.
public create ( object $query, array $options = [] ) : mixed
$query object
$options array
Résultat mixed

delete() public méthode

Used by model to DELETE.
public delete ( object $query, array $options = [] ) : string
$query object
$options array
Résultat string

describe() public méthode

Describe data source.
public describe ( string $entity, array $fields = [], array $meta = [] ) : array
$entity string
$fields array
$meta array
Résultat array - returns an empty array

disconnect() public méthode

Disconnect from socket.
public disconnect ( ) : boolean
Résultat boolean

read() public méthode

Read used by model to GET.
public read ( object $query, array $options = [] ) : string
$query object
$options array
Résultat string

relationship() public méthode

Defines or modifies the default settings of a relationship between two models.
public relationship ( string $class, string $type, string $name, array $options = [] ) : array
$class string
$type string
$name string
$options array
Résultat array Returns an array containing the configuration for a model relationship.

respondsTo() public méthode

Determines if a given method can be called.
public respondsTo ( string $method, boolean $internal = false ) : boolean
$method string Name of the method.
$internal boolean Provide `true` to perform check from inside the class/object. When `false` checks also for public visibility; defaults to `false`.
Résultat boolean Returns `true` if the method can be called, `false` otherwise.

send() public méthode

Method to send to a specific resource.
public send ( array $query = null, array $options = [] ) : mixed
$query array a query object
$options array array.
Résultat mixed

sources() public méthode

Returns available data sources (typically a list of REST resources collections).
public sources ( object $class = null ) : array
$class object
Résultat array

update() public méthode

Update used by model to PUT.
public update ( object $query, array $options = [] ) : string
$query object
$options array
Résultat string

Property Details

$_autoConfig protected_oe property

The set of array keys which will be auto-populated in the object's protected properties from constructor parameters.
protected array $_autoConfig
Résultat array

$_classes protected_oe property

Fully-namespaced class references
protected array $_classes
Résultat array

$_isConnected protected_oe property

Is Connected?
protected bool $_isConnected
Résultat boolean

$_methods protected_oe property

List of methods and their corresponding HTTP method and path.
protected array $_methods
Résultat array

$connection public_oe property

Service connection
public $connection