Trait for DAO Updates (Create, Update, Delete)
More...
|
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) |
|
Trait for DAO Updates (Create, Update, Delete)
- Author
- jc Database $db
Definition at line 15 of file DAOUpdatesTrait.php.
◆ 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 | $instance | the instance to insert |
boolean | $insertMany | if 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
-
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 | $instance | instance à 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 |
◆ update()
static update |
( |
|
$instance, |
|
|
|
$updateMany = false |
|
) |
| |
|
static |
Updates an existing $instance in the database.
Be careful not to modify the primary key
- Parameters
-
object | $instance | instance to modify |
boolean | $updateMany | Adds or updates ManyToMany members |
Definition at line 155 of file DAOUpdatesTrait.php.
The documentation for this class was generated from the following file: