PHP 클래스 lithium\data\collection\RecordSet

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

보호된 프로퍼티들

프로퍼티 타입 설명
$_columns array A 2D array of column-mapping information, where the top-level key is the fully-namespaced model name, and the sub-arrays are column names.
$_dependencies array A recursive array of relation dependencies where key are relations and value are arrays with their relation dependencies
$_keyIndex array Precompute index of the main model primary key(s) which allow to find values directly in result data without the column name matching process.
$_relationships array Holds the relationships as returned via $this->_query->relationships().
$_seen array Keeps a list of hydrated main record indexes values already seen.

보호된 메소드들

메소드 설명
_columnMap ( )
_hydrateRecord ( array $relations, string $primary, array $record, integer $min, integer $max, string $name ) : Record Hydrates a 2 dimensional PDO row Result array recursively.
_init ( ) : void Initializes the record set and uses the database connection to get the column list contained in the query that created this object.
_keyIndex ( ) : array Extracts the numerical index of the primary key in numerical indexed row data.
_mapRecord ( array $row ) : object Converts a PDO Result array to a nested Record object.
_populate ( ) : mixed Extracts the next item from the result resource and wraps it into a Record object.
_set ( $data = null, $offset = null, $options = [] )

메소드 상세

_columnMap() 보호된 메소드

protected _columnMap ( )

_hydrateRecord() 보호된 메소드

Hydrates a 2 dimensional PDO row Result array recursively.
protected _hydrateRecord ( array $relations, string $primary, array $record, integer $min, integer $max, string $name ) : Record
$relations array The cascading with relation
$primary string Model classname
$record array Loaded Records
$min integer
$max integer
$name string Alias name
리턴 lithium\data\entity\Record Returns a `Record` object as created by the model.

_init() 보호된 메소드

Initializes the record set and uses the database connection to get the column list contained in the query that created this object.
또한 보기: lithium\data\collection\RecordSet::$_columns
protected _init ( ) : void
리턴 void

_keyIndex() 보호된 메소드

Works only for the main row data and not for relationship rows. This method will also correctly detect a primary key which doesn't come first.
protected _keyIndex ( ) : array
리턴 array An array where key are index and value are primary key fieldname.

_mapRecord() 보호된 메소드

1. Builds an associative array with data from the row, with joined row data nested under the relationships name. Joined row data is added and new results consumed from the result cursor under the relationships name until the value of the main primary key changes. 2. The built array is then hydrated and returned. Note: Joined records must appear sequentially, when non-sequential records are detected an exception is thrown.
protected _mapRecord ( array $row ) : object
$row array 2 dimensional PDO `Result` array
리턴 object Returns a `Record` object

_populate() 보호된 메소드

Extracts the next item from the result resource and wraps it into a Record object.
protected _populate ( ) : mixed
리턴 mixed Returns the next `Record` if exists. Returns `null` otherwise

_set() 보호된 메소드

protected _set ( $data = null, $offset = null, $options = [] )

프로퍼티 상세

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

A 2D array of column-mapping information, where the top-level key is the fully-namespaced model name, and the sub-arrays are column names.
protected array $_columns
리턴 array

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

A recursive array of relation dependencies where key are relations and value are arrays with their relation dependencies
protected array $_dependencies
리턴 array

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

Precompute index of the main model primary key(s) which allow to find values directly in result data without the column name matching process.
protected array $_keyIndex
리턴 array

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

Holds the relationships as returned via $this->_query->relationships().
protected array $_relationships
리턴 array

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

Keeps a list of hydrated main record indexes values already seen.
protected array $_seen
리턴 array