PHP 클래스 phpDataMapper_Query, phpDataMapper

저자: Vance Lucas ([email protected])
상속: implements Countable, implements IteratorAggregate
파일 보기 프로젝트 열기: vlucas/phpDataMapper 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$conditions
$fields Storage for query properties
$group
$limit
$limitOffset
$order
$source

보호된 프로퍼티들

프로퍼티 타입 설명
$_mapper

공개 메소드들

메소드 설명
__construct ( phpDataMapper_Base $mapper ) Constructor Method
all ( array $conditions = [] ) Find records with given conditions If all parameters are empty, find all records
andWhere ( array $conditions = [], $type = "AND" )
count ( ) : integer SPL Countable function Called automatically when attribute is used in a 'count()' function call
execute ( ) : mixed Execute and return query as a collection
first ( ) : mixed Return the first entity matched by the query
from ( string $source = null ) From
getIterator ( ) : phpDataMapper_Query_Set SPL IteratorAggregate function Called automatically when attribute is used in a 'foreach' loop
group ( array $fields = [] ) GROUP BY clause
limit ( integer $limit = 20, integer $offset = null ) Limit executed query to specified amount of rows Implemented at adapter-level for databases that support it
mapper ( ) Get current adapter object
orWhere ( array $conditions = [], $type = "AND" )
order ( array $fields = [] ) ORDER BY columns
params ( ) : array Return array of parameters in key => value format
select ( mixed $fields = "*", string $source = null ) : string Called from mapper's select() function
toArray ( $keyColumn = null, $valueColumn = null ) : array Convenience function passthrough for Collection
where ( array $conditions = [], string $type = "AND", string $setType = "AND" ) WHERE conditions

메소드 상세

__construct() 공개 메소드

Constructor Method
public __construct ( phpDataMapper_Base $mapper )
$mapper phpDataMapper_Base

all() 공개 메소드

Find records with given conditions If all parameters are empty, find all records
public all ( array $conditions = [] )
$conditions array Array of conditions in column => value pairs

andWhere() 공개 메소드

public andWhere ( array $conditions = [], $type = "AND" )
$conditions array

count() 공개 메소드

SPL Countable function Called automatically when attribute is used in a 'count()' function call
public count ( ) : integer
리턴 integer

execute() 공개 메소드

Execute and return query as a collection
public execute ( ) : mixed
리턴 mixed Collection object on success, boolean false on failure

first() 공개 메소드

Return the first entity matched by the query
public first ( ) : mixed
리턴 mixed phpDataMapper_Entity on success, boolean false on failure

from() 공개 메소드

From
public from ( string $source = null )
$source string Name of the data source to perform a query on

getIterator() 공개 메소드

SPL IteratorAggregate function Called automatically when attribute is used in a 'foreach' loop
public getIterator ( ) : phpDataMapper_Query_Set
리턴 phpDataMapper_Query_Set

group() 공개 메소드

GROUP BY clause
public group ( array $fields = [] )
$fields array Array of field names to use for grouping

limit() 공개 메소드

Limit executed query to specified amount of rows Implemented at adapter-level for databases that support it
public limit ( integer $limit = 20, integer $offset = null )
$limit integer Number of records to return
$offset integer Row to start at for limited result set

mapper() 공개 메소드

Get current adapter object
public mapper ( )

orWhere() 공개 메소드

public orWhere ( array $conditions = [], $type = "AND" )
$conditions array

order() 공개 메소드

ORDER BY columns
public order ( array $fields = [] )
$fields array Array of field names to use for sorting

params() 공개 메소드

Return array of parameters in key => value format
public params ( ) : array
리턴 array Parameters in key => value format

select() 공개 메소드

Called from mapper's select() function
public select ( mixed $fields = "*", string $source = null ) : string
$fields mixed (optional)
$source string Data source name
리턴 string

toArray() 공개 메소드

Convenience function passthrough for Collection
public toArray ( $keyColumn = null, $valueColumn = null ) : array
리턴 array

where() 공개 메소드

WHERE conditions
public where ( array $conditions = [], string $type = "AND", string $setType = "AND" )
$conditions array Array of conditions for this clause
$type string Keyword that will separate each condition - "AND", "OR"
$setType string Keyword that will separate the whole set of conditions - "AND", "OR"

프로퍼티 상세

$_mapper 보호되어 있는 프로퍼티

protected $_mapper

$conditions 공개적으로 프로퍼티

public $conditions

$fields 공개적으로 프로퍼티

Storage for query properties
public $fields

$group 공개적으로 프로퍼티

public $group

$limit 공개적으로 프로퍼티

public $limit

$limitOffset 공개적으로 프로퍼티

public $limitOffset

$order 공개적으로 프로퍼티

public $order

$source 공개적으로 프로퍼티

public $source