PHP Класс lithium\data\source\http\adapter\CouchDb

Наследование: extends lithium\data\source\Http
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_classes array Classes used by CouchDb.
$_db boolean True if Database exists.
$_handlers
$_iterator string Increment value of current result set loop used by result to handle rows of json responses.

Открытые методы

Метод Описание
__call ( string $method, array $params = [] ) : mixed Magic for passing methods to http service.
__construct ( array $config = [] ) : void Constructor.
__destruct ( ) : void Destructor. Ensures that the server connection is closed and resources are freed when the adapter instance is destroyed.
calculation ( string $type, mixed $query, array $options = [] ) : integer Executes calculation-related queries, such as those required for count.
conditions ( string $conditions, string $context ) : array Handle conditions.
configureClass ( string $class ) : Returns Configures a model class by setting the primary key to 'id', in keeping with CouchDb conventions.
create ( string $query, array $options = [] ) : boolean Create new document.
delete ( string $query, array $options = [] ) : boolean Delete document.
describe ( string $entity, array $schema = [], array $meta = [] ) : lithium\data\Schema Describe database, create if it does not exist.
enabled ( string $feature = null ) : boolean With no parameter, always returns true, since CouchDB only depends on HTTP. With a parameter, queries for a specific supported feature.
fields ( string $fields, string $context ) : array Fields for query.
item ( string $model, array $data = [], array $options = [] ) : object Returns a newly-created Document object, bound to a model and populated with default data and options.
limit ( string $limit, string $context ) : array Limit for query.
name ( string $name ) : string Quotes identifiers.
order ( string $order, string $context ) : array Order for query.
read ( string $query, array $options = [] ) : object Read from document.
respondsTo ( string $method, boolean $internal = false ) : boolean Determines if a given method can be called.
sources ( object $class = null ) : void Returns an array of object types accessible through this database.
update ( string $query, array $options = [] ) : boolean Update document.

Защищенные методы

Метод Описание
_autoBuild ( string $result ) Helper used for auto building a CouchDB database.
_format ( array $data ) : array Formats a CouchDb result set into a standard result to be passed to item.
_init ( )

Описание методов

__call() публичный Метод

Magic for passing methods to http service.
public __call ( string $method, array $params = [] ) : mixed
$method string
$params array
Результат mixed

__construct() публичный Метод

Constructor.
public __construct ( array $config = [] ) : void
$config array Available configuration options are: - `'port'` _integer_ - `'version'` _integer_ - `'database'` _string_
Результат void

__destruct() публичный Метод

Destructor. Ensures that the server connection is closed and resources are freed when the adapter instance is destroyed.
public __destruct ( ) : void
Результат void

_autoBuild() защищенный Метод

Helper used for auto building a CouchDB database.
protected _autoBuild ( string $result )
$result string A query result.

_format() защищенный Метод

Formats a CouchDb result set into a standard result to be passed to item.
protected _format ( array $data ) : array
$data array data returned from query
Результат array

_init() защищенный Метод

protected _init ( )

calculation() публичный Метод

Executes calculation-related queries, such as those required for count.
public calculation ( string $type, mixed $query, array $options = [] ) : integer
$type string Only accepts `count`.
$query mixed The query to be executed.
$options array Optional arguments for the `read()` query that will be executed to obtain the calculation result.
Результат integer Result of the calculation.

conditions() публичный Метод

Handle conditions.
public conditions ( string $conditions, string $context ) : array
$conditions string
$context string
Результат array

configureClass() публичный Метод

Configures a model class by setting the primary key to 'id', in keeping with CouchDb conventions.
См. также: lithium\data\Model::$_meta
См. также: lithium\data\Model::$_classes
public configureClass ( string $class ) : Returns
$class string The fully-namespaced model class name to be configured.
Результат Returns an array containing keys `'classes'` and `'meta'`, which will be merged with their respective properties in `Model`.

create() публичный Метод

Create new document.
public create ( string $query, array $options = [] ) : boolean
$query string
$options array
Результат boolean

delete() публичный Метод

Delete document.
public delete ( string $query, array $options = [] ) : boolean
$query string
$options array
Результат boolean

describe() публичный Метод

Describe database, create if it does not exist.
public describe ( string $entity, array $schema = [], array $meta = [] ) : lithium\data\Schema
$entity string
$schema array Any schema data pre-defined by the model.
$meta array
Результат lithium\data\Schema

enabled() публичный статический Метод

With no parameter, always returns true, since CouchDB only depends on HTTP. With a parameter, queries for a specific supported feature.
public static enabled ( string $feature = null ) : boolean
$feature string Test for support for a specific feature, i.e. `"transactions"` or `"arrays"`.
Результат boolean Returns `true` if the particular feature support is enabled, otherwise `false`.

fields() публичный Метод

Fields for query.
public fields ( string $fields, string $context ) : array
$fields string
$context string
Результат array

item() публичный Метод

Returns a newly-created Document object, bound to a model and populated with default data and options.
public item ( string $model, array $data = [], array $options = [] ) : object
$model string A fully-namespaced class name representing the model class to which the `Document` object will be bound.
$data array The default data with which the new `Document` should be populated.
$options array Any additional options to pass to the `Document`'s constructor
Результат object Returns a new, un-saved `Document` object bound to the model class specified in `$model`.

limit() публичный Метод

Limit for query.
public limit ( string $limit, string $context ) : array
$limit string
$context string
Результат array

name() публичный Метод

CouchDb does not need identifiers quoted, so this method simply returns the identifier.
public name ( string $name ) : string
$name string The identifier to quote.
Результат string The quoted identifier.

order() публичный Метод

Order for query.
public order ( string $order, string $context ) : array
$order string
$context string
Результат array

read() публичный Метод

Read from document.
public read ( string $query, array $options = [] ) : object
$query string
$options array
Результат object

respondsTo() публичный Метод

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`.
Результат boolean Returns `true` if the method can be called, `false` otherwise.

sources() публичный Метод

Returns an array of object types accessible through this database.
public sources ( object $class = null ) : void
$class object
Результат void

update() публичный Метод

Update document.
public update ( string $query, array $options = [] ) : boolean
$query string
$options array
Результат boolean

Описание свойств

$_classes защищенное свойство

Classes used by CouchDb.
protected array $_classes
Результат array

$_db защищенное свойство

True if Database exists.
protected bool $_db
Результат boolean

$_handlers защищенное свойство

protected $_handlers

$_iterator защищенное свойство

Increment value of current result set loop used by result to handle rows of json responses.
protected string $_iterator
Результат string