\Hazaar\DBI
Table
Relational Database Interface - Table Class

The Table class is used to access table data via an abstracted interface. That means that now SQL is used to access table data and queries are generated automatically using access methods. The generation of SQL is then handled by the database driver so that database specific SQL can be used when required. This allows a common interface for accessing data that is compatible across all of the database drivers.

Example Usage

$db = new Hazaar\DBI(); $result = $db->users->find(array('uname' => 'myusername'))->join('images', array('image' => array('$ref' => 'images.id'))); while($row = $result->fetch()){ //Do things with $row here }

Summary
Methods Properties Constants
all
key
row
No constants
Properties
$alias
$alias
$criteria
$criteria
$driver
$driver
$fields
$fields
$joins
$joins
$limit
$limit
$name
$name
$offset
$offset
$order
$order
$result
$result
Methods
__construct()
__construct($driver, $name, $alias = null)

Parameters

$driver\Hazaar\DBI\DBD\BaseDriver

No description

$name

No description

$alias

No description

__tostring()
__tostring()
all()
all()
count()
count()
current()
current()
delete()
delete($criteria)

Parameters

$criteria

No description

deleteAll()
deleteAll()
execute()
execute()
exists()
exists($criteria = null)

Parameters

$criteria

No description

fetch()
fetch($offset = 0)

Parameters

$offset

No description

fetchAll()
fetchAll()
fields()
fields($fields)

Parameters

$fields

No description

find()
find($criteria = Array ( ) , $fields = Array ( ) ) : \Hazaar\DBI\Table

Parameters

$criteriaarray

No description

$fieldsarray

No description

Returns

\Hazaar\DBI\Table
findOne()
findOne($criteria = Array ( ) , $fields = Array ( ) , $order = null)

Parameters

$criteria

No description

$fields

No description

$order

No description

from()
from()
fullJoin()
fullJoin($references, $on = Array ( ) , $alias = null)

Parameters

$references

No description

$on

No description

$alias

No description

getResult()
getResult()
innerJoin()
innerJoin($references, $on = Array ( ) , $alias = null)

Parameters

$references

No description

$on

No description

$alias

No description

insert()
insert($fields, $returning = null)

Parameters

$fields

No description

$returning

No description

join()
join($references, $on = Array ( ) , $alias = null, $type = 'INNER')

Parameters

$references

No description

$on

No description

$alias

No description

$type

No description

key()
key()
leftJoin()
leftJoin($references, $on = Array ( ) , $alias = null)

Parameters

$references

No description

$on

No description

$alias

No description

limit()
limit($limit = 1)

Parameters

$limit

No description

next()
next()
offset()
offset($offset)

Parameters

$offset

No description

offsetExists()
offsetExists($offset)

Parameters

$offset

No description

offsetGet()
offsetGet($offset)

Parameters

$offset

No description

offsetSet()
offsetSet($offset, $value)

Parameters

$offset

No description

$value

No description

offsetUnset()
offsetUnset($offset)

Parameters

$offset

No description

reset()
reset()
rewind()
rewind()
rightJoin()
rightJoin($references, $on = Array ( ) , $alias = null)

Parameters

$references

No description

$on

No description

$alias

No description

row()
row()
sort()
sort($field_def, $desc = false)

Parameters

$field_def

No description

$desc

No description

toString()
toString($terminate_with_colon = true)

Parameters

$terminate_with_colon

No description

update()
update($criteria, $fields)

Parameters

$criteria

No description

$fields

No description

valid()
valid()
where()
where($criteria)

Parameters

$criteria

No description