PHP 클래스 lithium\data\source\http\adapter\CouchDb

상속: extends lithium\data\source\Http
파일 보기 프로젝트 열기: unionofrad/lithium 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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