Constants

FETCH_TYPE_ROW

FETCH_TYPE_ROW = 0

FETCH_TYPE_ALL

FETCH_TYPE_ALL = 1

Properties

$connection

$connection : 

Type

$lastConnection

$lastConnection : 

Type

$fields

$fields : 

Type

Methods

getLastInsertId()

getLastInsertId() 

getConnection()

getConnection() 

CallStoredProc()

CallStoredProc(  $_procName,   $_params,   $_fetch_type,   $_className = NULL,   $_fetch_opt = NULL) 

Parameters

$_procName
$_params
$_fetch_type
$_className
$_fetch_opt

Prepare()

Prepare(  $_query,   $_params,   $_fetchType = self::FETCH_TYPE_ROW,   $_fetch_param = \PDO::FETCH_ASSOC,   $_fetch_opt = NULL) 

Parameters

$_query
$_params
$_fetchType
$_fetch_param
$_fetch_opt

__clone()

__clone() 

optimize()

optimize() 

beginTransaction()

beginTransaction() 

commit()

commit() 

rollBack()

rollBack() 

save()

save(object  $object,   $_direct = false,   $_replace = false) : boolean

Saves an entity inside the repository. If the entity is new a new row will be created. If the entity is not new the row will be updated.

Parameters

object $object
$_direct
$_replace

Returns

boolean

refresh()

refresh(  $object) 

Parameters

$object

getWithFilter()

getWithFilter(  $_filters,   $_object) : \Objet

Retourne une liste d'objets ou un objet en fonction de filtres

Parameters

$_filters

Filtres à appliquer

$_object

Objet sur lequel appliquer les filtres

Returns

\Objet —

ou liste d'objets correspondant à la requête

remove()

remove(object  $object) : boolean

Deletes an entity.

Parameters

object $object

Returns

boolean

checksum()

checksum(  $_table) 

Parameters

$_table

lock()

lock(object  $object) : boolean

Lock an entity.

Parameters

object $object

Returns

boolean

buildField()

buildField(  $_class,   $_prefix = '') 

Parameters

$_class
$_prefix

compareAndFix()

compareAndFix(  $_database,   $_table = 'all',   $_verbose = false,   $_loop) 

Parameters

$_database
$_table
$_verbose
$_loop

compareDatabase()

compareDatabase(  $_database) 

Parameters

$_database

compareTable()

compareTable(  $_table) 

Parameters

$_table

prepareIndexCompare()

prepareIndexCompare(  $indexes) 

Parameters

$indexes

compareField()

compareField(  $_ref_field,   $_real_field,   $_table_name) 

Parameters

$_ref_field
$_real_field
$_table_name

compareIndex()

compareIndex(  $_ref_index,   $_real_index,   $_table_name,   $_forceRebuild = false) 

Parameters

$_ref_index
$_real_index
$_table_name
$_forceRebuild

buildDefinitionField()

buildDefinitionField(  $_field) 

Parameters

$_field

buildDefinitionIndex()

buildDefinitionIndex(  $_index,   $_table_name) 

Parameters

$_index
$_table_name

initConnection()

initConnection() 

getTableName()

getTableName(  $object) : string

Returns the name of the table where to save entities.

Parameters

$object

Returns

string

getFields()

getFields(\type  $object) : \type

Parameters

\type $object

Throws

\RuntimeException

Returns

\type

setField()

setField(object  $object, string  $field, mixed  $value) 

Forces the value of a field of a given object, even if this field is not accessible.

Parameters

object $object

The entity to alter

string $field

The name of the member to alter

mixed $value

The value to give to the member

buildQuery()

buildQuery(\type  $object) : \type

Builds the elements for an SQL query. It will return two lists, the first being the list of parts "key=:key" to inject in the SQL, the second being the mapping of these parameters to the values.

Parameters

\type $object

Returns

\type

getField()

getField(\type  $object, \type  $field) : \type

Returns the value of a field of a given object. It'll try to use a getter first if defined. If not defined, we'll use the reflection API.

Parameters

\type $object
\type $field

Throws

\RuntimeException

if the getter is not defined

Returns

\type

getReflectionClass()

getReflectionClass(object  $object) : \ReflectionClass

Returns the reflection class for the given object.

Parameters

object $object

Returns

\ReflectionClass