Interface

DAO

Package: MVC\Model Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Loic ROUCHON horn@phpboost.com Version: PHPBoost 5.2 - last update: 2014 12 22 Since: PHPBoost 3.0 - 2009 10 02 Located at: mvc/model/DAO.class.php

Describes a simple way to interact with a table

Direct known implementers
SQLDAO
Methods summary
public
# save( PropertiesMapInterface $object )

Saves

$object

in the table. If the object does not exist, it is created, else, just updated

public
# update( array $fields, string $where = DAO::WHERE_ALL, array $parameters = array() )

Update all fields in the table to the given value if row match the where clause.

public
# delete( PropertiesMapInterface $object )

Deletes

$object

from the table. If the object does not exist, nothing is done

public
# delete_all( string $where = DAO::WHERE_ALL, array $parameters = array() )

Deletes all object matching the where clause from the table.

public
# count( string $where = DAO::WHERE_ALL, array $parameters = array() )

Count the number of object in the table matching the

$where

clause

public PropertiesMapInterface
# find_by_id( mixed $id )

retrieves the object with the

$id

primary identifier

public QueryResultMapper
# find_all( integer $limit = 100, integer $offset = 0, string[mixed][] $order_by = array() )

retrieves the

$limit

first objects from the

$offset

one. If

$order_by

is specified, objects will be sorted in the

$way

way

public QueryResultMapper
# find_by_criteria( string $criteria, string[string] $parameters = array() )

retrieves all the objects in the table matching the

$criteria
Constants summary
integer FIND_ALL
# 0
string WHERE_ALL
# 'WHERE 1'