Skip to content

Commit 4026f0d

Browse files
committed
Ajout du gestionnaire pour les requêtes de suppressions
1 parent ab85ef9 commit 4026f0d

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

includes/applications/dev.config.json

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{
44
"main":
55
{
6-
"theme":"default",
76
"multiLanguage": false,
87
"defaultLanguage": "fr",
98
"currentLanguage": "fr",

includes/libs/core/application/class.Application.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ class Application extends Singleton
4646
*/
4747
public $defaultLanguage = "fr";
4848

49+
/**
50+
* @var string
51+
*/
52+
public $dbHandler = "default";
53+
4954
/**
5055
* @var string
5156
*/
@@ -57,7 +62,7 @@ class Application extends Singleton
5762
public function __construct(PrivateClass $pInstance)
5863
{
5964
if(!$pInstance instanceOf PrivateClass)
60-
trigger_error("Il est interdit d'instancier un objet de type <i>Singleton</i> - Merci d'utiliser la m�thode static <i>".__CLASS__."::getInstance()</i>", E_USER_ERROR);
65+
trigger_error("Il est interdit d'instancier un objet de type <i>Singleton</i> - Merci d'utiliser la méthode static <i>".__CLASS__."::getInstance()</i>", E_USER_ERROR);
6166
}
6267

6368
/**
@@ -74,7 +79,7 @@ public function setup($pName = self::DEFAULT_APPLICATION)
7479
}
7580
if(!Configuration::$applications[$this->name])
7681
{
77-
trigger_error("L'application ".$this->name." n'a pas �t� d�finie dans le fichier de configuration.", E_USER_ERROR);
82+
trigger_error("L'application ".$this->name." n'a pas été définie dans le fichier de configuration.", E_USER_ERROR);
7883
}
7984

8085
$data = Configuration::$applications[$this->name];

includes/libs/core/application/class.BaseModel.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BaseModel implements InterfaceBackModel
3232
* Identifiant du gestionnaire de la base de données à utiliser pour exécuter les requêtes du model
3333
* @var String
3434
*/
35-
protected $handler = "default";
35+
protected $handler;
3636

3737
/**
3838
* Tableau contenant les informations de jointures à ajout systématiquement sur les SELECT
@@ -48,6 +48,7 @@ public function __construct($pTable, $pId)
4848
{
4949
$this->table = $pTable;
5050
$this->id = $pId;
51+
$this->handler = Application::getInstance()->dbHandler;
5152
}
5253

5354
/**
@@ -136,7 +137,7 @@ public function deleteById($pId)
136137
**/
137138
public function delete($pCondition)
138139
{
139-
return Query::delete()->from($this->table)->setCondition($pCondition)->execute();
140+
return Query::delete()->from($this->table)->setCondition($pCondition)->execute($this->handler);
140141
}
141142

142143
/**

0 commit comments

Comments
 (0)