Methods summary
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
TinyDBModel
|
#
map( array $row )
Map array to model
Parameters
Returns
|
public
array
|
#
mapModels( array $rows )
Map data rows to model array
Map data rows to model array
Parameters
Returns
array
|
public
|
#
create( array $row = array() )
Create a fresh model from array
Create a fresh model from array
Parameters
|
protected
array
|
#
buildPKConditions( string|array $pk, mixed $_data )
Build PK condition(multiple pk is also supported)
Build PK condition(multiple pk is also supported)
Parameters
- $pk
string|array $pk
- $_data
mixed $_data
Returns
array
|
public
integer
|
#
count( string|array $conditions = '', array $params = array() )
Count with conditions
Parameters
- $conditions
string|array $conditions
- $params
array $params
Returns
integer
|
public
integer
|
#
countBy( string $key, mixed $value )
Count by key
Parameters
- $key
string $key
- $value
mixed $value
Returns
integer
|
public
|
|
public
|
|
public
boolean|TinyDBModel
|
#
findOne( string|array $conditions, array $params = array() )
Find one model with conditions
Find one model with conditions
Parameters
- $conditions
string|array $conditions
- $params
array $params
Returns
|
public
boolean|TinyDBModel
|
#
findOneBy( string $key, mixed $value )
Find one model by key
Parameters
- $key
string $key
- $value
mixed $value
Returns
|
public
boolean|TinyDBModel
|
#
findByPK( string|array $pk )
Find one model by primary key
Find one model by primary key
Parameters
Returns
|
public
boolean|array
|
#
findMany( string|array $conditions = '', array $params = array(), string|array $orderBy = null, integer $limit = null, integer $offset = null )
Find many models with conditions
Find many models with conditions
Parameters
- $conditions
string|array $conditions
- $params
array $params
- $orderBy
string|array $orderBy
- $limit
integer $limit
- $offset
integer $offset
Returns
boolean|array
|
public
boolean|array
|
#
findManyBy( string $key, mixed $value, string|array $orderBy = null, integer $limit = null, integer $offset = null )
Find many models with by key
Find many models with by key
Parameters
- $key
string $key
- $value
mixed $value
- $orderBy
string|array $orderBy
- $limit
integer $limit
- $offset
integer $offset
Returns
boolean|array
|
public
integer|boolean
|
#
update( array $values, string|array $conditions = '', array $params = array() )
Update table with condition
Update table with condition
Parameters
- $values
array $values
- $conditions
string|array $conditions
- $params
array $params
Returns
integer|boolean
|
public
integer|boolean
|
#
updateBy( string $key, mixed $value, array $values )
Update table by key
Parameters
- $key
string $key
- $value
mixed $value
- $values
array $values
Returns
integer|boolean
|
public
integer|boolean
|
#
updateByPK( string|array $pk, array $values )
Update table by primary key
Update table by primary key
Parameters
- $pk
string|array $pk
- $values
array $values
Returns
integer|boolean
|
public
integer|boolean
|
#
insert( array $values )
Insert
Parameters
Returns
integer|boolean
|
public
integer|boolean
|
#
delete( string|array $conditions = '', array $params = array() )
Delete with condition
Parameters
- $conditions
string|array $conditioins
- $params
array $params
Returns
integer|boolean
|
public
integer|boolean
|
#
deleteBy( string $key, mixed $value )
Delete by key
Parameters
- $key
string $key
- $value
mixed $value
Returns
integer|boolean
|
public
integer|boolean
|
#
deleteByPK( string|array $pk )
Delete by primary key
Parameters
Returns
integer|boolean
|
public
mixed
|
#
__call( string $name, array $arguments )
Override __call magic method to provide many helper methods
Override __call magic method to provide many helper methods
Parameters
- $name
string $name
- $arguments
array $arguments
Returns
mixed
|