PHP Class Bluz\Crud\Table

Inheritance: extends AbstractCrud
Show file Open project: bluzphp/framework Class Usage Examples

Protected Properties

Property Type Description
$table instance of Db\Table

Public Methods

Method Description
createOne ( array $data ) : integer Create item
deleteOne ( mixed $primary ) : integer Delete item
getPrimaryKey ( ) : array Get primary key
getTable ( ) : Table Return table instance for manipulation
readOne ( mixed $primary ) : Row Get record from Db or create new object
readSet ( integer $offset, integer $limit = 10, array $params = [], integer &$total = null ) : array | integer | mixed Get set of records
setTable ( Table $table ) : self Setup Table instance
updateOne ( mixed $primary, array $data ) : integer Update item

Method Details

createOne() public method

Create item
public createOne ( array $data ) : integer
$data array
return integer

deleteOne() public method

Delete item
public deleteOne ( mixed $primary ) : integer
$primary mixed
return integer

getPrimaryKey() public method

Get primary key
public getPrimaryKey ( ) : array
return array

getTable() public method

Return table instance for manipulation
public getTable ( ) : Table
return Bluz\Db\Table

readOne() public method

Get record from Db or create new object
public readOne ( mixed $primary ) : Row
$primary mixed
return Bluz\Db\Row

readSet() public method

Get set of records
public readSet ( integer $offset, integer $limit = 10, array $params = [], integer &$total = null ) : array | integer | mixed
$offset integer
$limit integer
$params array
$total integer
return array | integer | mixed

setTable() public method

Setup Table instance
public setTable ( Table $table ) : self
$table Bluz\Db\Table
return self

updateOne() public method

Update item
public updateOne ( mixed $primary, array $data ) : integer
$primary mixed
$data array
return integer

Property Details

$table protected property

instance of Db\Table
protected $table