DB
in package
Table of Contents
Constants
- FETCH_TYPE_ALL = 1
- FETCH_TYPE_ROW = 0
Properties
- $connection : mixed
- $fields : mixed
- $lastConnection : mixed
Methods
- __clone() : mixed
- beginTransaction() : mixed
- buildDefinitionField() : mixed
- buildDefinitionIndex() : mixed
- buildField() : mixed
- CallStoredProc() : mixed
- checksum() : mixed
- commit() : mixed
- compareAndFix() : mixed
- compareDatabase() : mixed
- compareField() : mixed
- compareIndex() : mixed
- compareTable() : mixed
- getConnection() : mixed
- getLastInsertId() : mixed
- getWithFilter() : Objet
- Retourne une liste d'objets ou un objet en fonction de filtres
- lock() : bool
- Lock an entity.
- optimize() : mixed
- Prepare() : mixed
- prepareIndexCompare() : mixed
- refresh() : mixed
- remove() : bool
- Deletes an entity.
- rollBack() : mixed
- save() : bool
- 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.
- buildQuery() : array<string|int, mixed>
- 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.
- getField() : mixed
- 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.
- getFields() : mixed
- getReflectionClass() : ReflectionClass
- Returns the reflection class for the given object.
- getTableName() : string
- Returns the name of the table where to save entities.
- initConnection() : mixed
- setField() : mixed
- Forces the value of a field of a given object, even if this field is not accessible.
Constants
FETCH_TYPE_ALL
public
mixed
FETCH_TYPE_ALL
= 1
FETCH_TYPE_ROW
public
mixed
FETCH_TYPE_ROW
= 0
Properties
$connection
private
static mixed
$connection
= \null
$fields
private
static mixed
$fields
= array()
$lastConnection
private
static mixed
$lastConnection
Methods
__clone()
public
__clone() : mixed
beginTransaction()
public
static beginTransaction() : mixed
buildDefinitionField()
public
static buildDefinitionField(mixed $_field) : mixed
Parameters
- $_field : mixed
buildDefinitionIndex()
public
static buildDefinitionIndex(mixed $_index, mixed $_table_name) : mixed
Parameters
- $_index : mixed
- $_table_name : mixed
buildField()
public
static buildField(mixed $_class[, mixed $_prefix = '' ]) : mixed
Parameters
- $_class : mixed
- $_prefix : mixed = ''
CallStoredProc()
public
static & CallStoredProc(mixed $_procName, mixed $_params, mixed $_fetch_type[, mixed $_className = NULL ][, mixed $_fetch_opt = NULL ]) : mixed
Parameters
- $_procName : mixed
- $_params : mixed
- $_fetch_type : mixed
- $_className : mixed = NULL
- $_fetch_opt : mixed = NULL
checksum()
public
static checksum(mixed $_table) : mixed
Parameters
- $_table : mixed
commit()
public
static commit() : mixed
compareAndFix()
public
static compareAndFix(mixed $_database[, mixed $_table = 'all' ][, mixed $_verbose = false ][, mixed $_loop = 0 ]) : mixed
Parameters
- $_database : mixed
- $_table : mixed = 'all'
- $_verbose : mixed = false
- $_loop : mixed = 0
compareDatabase()
public
static compareDatabase(mixed $_database) : mixed
Parameters
- $_database : mixed
compareField()
public
static compareField(mixed $_ref_field, mixed $_real_field, mixed $_table_name) : mixed
Parameters
- $_ref_field : mixed
- $_real_field : mixed
- $_table_name : mixed
compareIndex()
public
static compareIndex(mixed $_ref_index, mixed $_real_index, mixed $_table_name[, mixed $_forceRebuild = false ]) : mixed
Parameters
- $_ref_index : mixed
- $_real_index : mixed
- $_table_name : mixed
- $_forceRebuild : mixed = false
compareTable()
public
static compareTable(mixed $_table) : mixed
Parameters
- $_table : mixed
getConnection()
public
static getConnection() : mixed
getLastInsertId()
public
static getLastInsertId() : mixed
getWithFilter()
Retourne une liste d'objets ou un objet en fonction de filtres
public
static getWithFilter( $_filters, $_object) : Objet
Parameters
Return values
Objet —ou liste d'objets correspondant à la requête
lock()
Lock an entity.
public
static lock(object $object) : bool
Parameters
- $object : object
Return values
booloptimize()
public
static optimize() : mixed
Prepare()
public
static & Prepare(mixed $_query, mixed $_params[, mixed $_fetchType = self::FETCH_TYPE_ROW ][, mixed $_fetch_param = PDO::FETCH_ASSOC ][, mixed $_fetch_opt = NULL ]) : mixed
Parameters
- $_query : mixed
- $_params : mixed
- $_fetchType : mixed = self::FETCH_TYPE_ROW
- $_fetch_param : mixed = PDO::FETCH_ASSOC
- $_fetch_opt : mixed = NULL
prepareIndexCompare()
public
static prepareIndexCompare(mixed $indexes) : mixed
Parameters
- $indexes : mixed
refresh()
public
static refresh(mixed $object) : mixed
Parameters
- $object : mixed
remove()
Deletes an entity.
public
static remove(object $object) : bool
Parameters
- $object : object
Return values
boolrollBack()
public
static rollBack() : mixed
save()
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.
public
static save(object $object[, mixed $_direct = false ][, mixed $_replace = false ]) : bool
Parameters
- $object : object
- $_direct : mixed = false
- $_replace : mixed = false
Return values
boolbuildQuery()
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.
private
static buildQuery(mixed $object) : array<string|int, mixed>
Parameters
- $object : mixed
Return values
array<string|int, mixed>getField()
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.
private
static getField(object $object, string $field) : mixed
Parameters
- $object : object
- $field : string
Tags
getFields()
private
static getFields(mixed $object) : mixed
Parameters
- $object : mixed
Tags
getReflectionClass()
Returns the reflection class for the given object.
private
static getReflectionClass(object $object) : ReflectionClass
Parameters
- $object : object
Return values
ReflectionClassgetTableName()
Returns the name of the table where to save entities.
private
static getTableName(mixed $object) : string
Parameters
- $object : mixed
Return values
stringinitConnection()
private
static initConnection() : mixed
setField()
Forces the value of a field of a given object, even if this field is not accessible.
private
static setField(object $object, string $field, mixed $value) : mixed
Parameters
- $object : object
-
The entity to alter
- $field : string
-
The name of the member to alter
- $value : mixed
-
The value to give to the member