Ubiquity  2.0.0
php rapid development framework
DAOUpdatesTrait Class Reference

Trait for DAO Updates (Create, Update, Delete) More...

+ Inheritance diagram for DAOUpdatesTrait:

Static Public Member Functions

static remove ($instance)
 Deletes the object $instance from the database. More...
 
static delete ($modelName, $ids)
 
static insert ($instance, $insertMany=false)
 Inserts a new instance $ instance into the database. More...
 
static insertOrUpdateAllManyToMany ($instance)
 Met à jour les membres de $instance annotés par un ManyToMany. More...
 
static insertOrUpdateManyToMany ($instance, $member)
 Updates the $member member of $instance annotated by a ManyToMany. More...
 
static update ($instance, $updateMany=false)
 Updates an existing $instance in the database. More...
 
static save ($instance, $updateMany=false)
 

Static Private Member Functions

static removeByKey_ ($tableName, $keyAndValues)
 
static remove_ ($tableName, $where)
 

Detailed Description

Trait for DAO Updates (Create, Update, Delete)

Author
jc Database $db

Definition at line 15 of file DAOUpdatesTrait.php.

Member Function Documentation

◆ delete()

static delete (   $modelName,
  $ids 
)
static
Parameters
string$modelName
array | int$ids
Returns
int

Definition at line 61 of file DAOUpdatesTrait.php.

◆ insert()

static insert (   $instance,
  $insertMany = false 
)
static

Inserts a new instance $ instance into the database.

Parameters
object$instancethe instance to insert
boolean$insertManyif true, save instances related to $instance by a ManyToMany association

Definition at line 76 of file DAOUpdatesTrait.php.

◆ insertOrUpdateAllManyToMany()

static insertOrUpdateAllManyToMany (   $instance)
static

Met à jour les membres de $instance annotés par un ManyToMany.

Parameters
object$instance

Definition at line 102 of file DAOUpdatesTrait.php.

◆ insertOrUpdateManyToMany()

static insertOrUpdateManyToMany (   $instance,
  $member 
)
static

Updates the $member member of $instance annotated by a ManyToMany.

Parameters
Object$instance
String$member

Definition at line 117 of file DAOUpdatesTrait.php.

◆ remove()

static remove (   $instance)
static

Deletes the object $instance from the database.

Parameters
object$instanceinstance à supprimer

Definition at line 22 of file DAOUpdatesTrait.php.

◆ remove_()

static remove_ (   $tableName,
  $where 
)
staticprivate
Parameters
string$tableName
string$where
Returns
int the number of rows that were modified or deleted by the SQL statement you issued

Definition at line 49 of file DAOUpdatesTrait.php.

◆ removeByKey_()

static removeByKey_ (   $tableName,
  $keyAndValues 
)
staticprivate
Parameters
string$tableName
string$keyAndValues
Returns
int the number of rows that were modified or deleted by the SQL statement you issued

Definition at line 33 of file DAOUpdatesTrait.php.

◆ save()

static save (   $instance,
  $updateMany = false 
)
static
Parameters
object$instance
boolean$updateMany
Returns
int

Definition at line 178 of file DAOUpdatesTrait.php.

◆ update()

static update (   $instance,
  $updateMany = false 
)
static

Updates an existing $instance in the database.

Be careful not to modify the primary key

Parameters
object$instanceinstance to modify
boolean$updateManyAdds or updates ManyToMany members

Definition at line 155 of file DAOUpdatesTrait.php.


The documentation for this class was generated from the following file: