PHP 클래스 DB\SQL\Mapper

상속: extends DB\Cursor
파일 보기 프로젝트 열기: bcosca/fatfree 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_id
$adhoc
$db
$engine
$fields
$source
$table

공개 메소드들

메소드 설명
__construct ( SQL $db, $table, $fields = NULL, $ttl = 60 ) Instantiate class
cast ( $obj = NULL ) : array Return fields of mapper object as an associative array
changed ( $key = NULL ) : boolean Return TRUE if any/specified field value has changed
clear ( $key ) : null Clear value of field
copyfrom ( $var, $func = NULL ) : null Hydrate mapper object using hive array variable
copyto ( $key ) : null Populate hive array variable with mapper fields
count ( $filter = NULL, $ttl ) : integer Count records that match criteria
dbtype ( ) : string Return database type
erase ( $filter = NULL ) : integer Delete current record
exists ( $key ) : boolean Return TRUE if field is defined
fields ( $adhoc = TRUE ) : array Return field names
find ( $filter = NULL, array $options = NULL, $ttl ) : static[] Return records that match criteria
get ( $key ) : scalar Retrieve value of field
getiterator ( ) : object Retrieve external iterator for fields
insert ( ) : object Insert new record
required ( $field ) : boolean Return TRUE if field is not nullable
reset ( ) : null Reset cursor
schema ( $fields = null ) : array Return schema and, if the first argument is provided, update it
select ( $fields, $filter = NULL, array $options = NULL, $ttl ) : static[] Build query string and execute
set ( $key, $val ) : scalar Assign value to field
skip ( $ofs = 1 ) : array Return record at specified offset using same criteria as previous load() call and make it active
table ( ) : string Return mapped table
type ( $pdo ) : string Get PHP type equivalent of PDO constant
update ( ) : object Update current record

보호된 메소드들

메소드 설명
factory ( $row ) : object Convert array to mapper object

메소드 상세

__construct() 공개 메소드

Instantiate class
public __construct ( SQL $db, $table, $fields = NULL, $ttl = 60 )
$db DB\SQL object
$table string
$fields array|string
$ttl int|array

cast() 공개 메소드

Return fields of mapper object as an associative array
public cast ( $obj = NULL ) : array
$obj object
리턴 array

changed() 공개 메소드

Return TRUE if any/specified field value has changed
public changed ( $key = NULL ) : boolean
$key string
리턴 boolean

clear() 공개 메소드

Clear value of field
public clear ( $key ) : null
$key string
리턴 null

copyfrom() 공개 메소드

Hydrate mapper object using hive array variable
public copyfrom ( $var, $func = NULL ) : null
$var array|string
$func callback
리턴 null

copyto() 공개 메소드

Populate hive array variable with mapper fields
public copyto ( $key ) : null
$key string
리턴 null

count() 공개 메소드

Count records that match criteria
public count ( $filter = NULL, $ttl ) : integer
$filter string|array
$ttl int|array
리턴 integer

dbtype() 공개 메소드

Return database type
public dbtype ( ) : string
리턴 string

erase() 공개 메소드

Delete current record
public erase ( $filter = NULL ) : integer
$filter string|array
리턴 integer

exists() 공개 메소드

Return TRUE if field is defined
public exists ( $key ) : boolean
$key string
리턴 boolean

factory() 보호된 메소드

Convert array to mapper object
protected factory ( $row ) : object
$row array
리턴 object

fields() 공개 메소드

Return field names
public fields ( $adhoc = TRUE ) : array
$adhoc bool
리턴 array

find() 공개 메소드

Return records that match criteria
public find ( $filter = NULL, array $options = NULL, $ttl ) : static[]
$filter string|array
$options array array
$ttl int|array
리턴 static[]

get() 공개 메소드

Retrieve value of field
public get ( $key ) : scalar
$key string
리턴 scalar

getiterator() 공개 메소드

Retrieve external iterator for fields
public getiterator ( ) : object
리턴 object

insert() 공개 메소드

Insert new record
public insert ( ) : object
리턴 object

required() 공개 메소드

Return TRUE if field is not nullable
public required ( $field ) : boolean
$field string
리턴 boolean

reset() 공개 메소드

Reset cursor
public reset ( ) : null
리턴 null

schema() 공개 메소드

Return schema and, if the first argument is provided, update it
public schema ( $fields = null ) : array
$fields NULL|array
리턴 array

select() 공개 메소드

Build query string and execute
public select ( $fields, $filter = NULL, array $options = NULL, $ttl ) : static[]
$fields string
$filter string|array
$options array array
$ttl int|array
리턴 static[]

set() 공개 메소드

Assign value to field
public set ( $key, $val ) : scalar
$key string
$val scalar
리턴 scalar

skip() 공개 메소드

Return record at specified offset using same criteria as previous load() call and make it active
public skip ( $ofs = 1 ) : array
$ofs int
리턴 array

table() 공개 메소드

Return mapped table
public table ( ) : string
리턴 string

type() 공개 메소드

Get PHP type equivalent of PDO constant
public type ( $pdo ) : string
$pdo string
리턴 string

update() 공개 메소드

Update current record
public update ( ) : object
리턴 object

프로퍼티 상세

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

protected $_id

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

protected $adhoc

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

protected $db

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

protected $engine

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

protected $fields

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

protected $source

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

protected $table