Correction 'binded' -> 'bound'
This commit is contained in:
parent
fd04fb2593
commit
713dc777c8
|
@ -424,7 +424,7 @@
|
|||
$requestS = [];
|
||||
|
||||
/* (2) On initialise les paramètres */
|
||||
$binded = [];
|
||||
$bound = [];
|
||||
|
||||
|
||||
|
||||
|
@ -436,7 +436,7 @@
|
|||
/* [3] Rédaction de la clause SET
|
||||
=========================================================*/
|
||||
/* (1) On met tout les champs à modifier */
|
||||
$requestS['SET'] = SQLBuilder::SET($cleared, $binded);
|
||||
$requestS['SET'] = SQLBuilder::SET($cleared, $bound);
|
||||
|
||||
|
||||
/* [4] On rédige la clause WHERE/AND
|
||||
|
@ -448,9 +448,9 @@
|
|||
foreach($conditions as $cdt=>$value){
|
||||
|
||||
if( $value[1] == self::COND_IN ) // Si condition de type IN
|
||||
$requestS['WHERE'][$c] = SQLBuilder::IN([$this->schema['table'], $field], $value[0], $c, $binded);
|
||||
$requestS['WHERE'][$c] = SQLBuilder::IN([$this->schema['table'], $field], $value[0], $c, $bound);
|
||||
else // Sinon
|
||||
$requestS['WHERE'][$c] = SQLBuilder::WHERE([$this->schema['table'], $field], $value, $c, $binded);
|
||||
$requestS['WHERE'][$c] = SQLBuilder::WHERE([$this->schema['table'], $field], $value, $c, $bound);
|
||||
|
||||
$c++;
|
||||
}
|
||||
|
@ -474,7 +474,7 @@
|
|||
$requestS['WHERE'][] = $this->schema['table'].".$field in ($joinedRequest)";
|
||||
|
||||
// {6} On ajoute les variables à la requête courante //
|
||||
$binded = array_merge($binded, $joinedFetched['binded']);
|
||||
$bound = array_merge($bound, $joinedFetched['bound']);
|
||||
}
|
||||
|
||||
|
||||
|
@ -496,7 +496,7 @@
|
|||
/* [7] On exécute la requête et retourne le résultat
|
||||
=========================================================*/
|
||||
/* (1) On exécute la requête */
|
||||
$updated = $request->execute($binded);
|
||||
$updated = $request->execute($bound);
|
||||
|
||||
/* (2) On retourne l'état de la requête */
|
||||
return $updated;
|
||||
|
@ -615,18 +615,18 @@
|
|||
=========================================================*/
|
||||
/* (0) On initialise la requête et les paramètres */
|
||||
$request = Database::getPDO()->prepare($requestS.';');
|
||||
$binded = [];
|
||||
$bound = [];
|
||||
|
||||
/* (1) On bind les paramètres */
|
||||
foreach($cleared as $i=>$set)
|
||||
foreach($this->schema['columns'] as $field=>$column)
|
||||
if( isset($set[$field]) && $set[$field] != self::DEFAULT )
|
||||
$binded[':insert_'.$field.'_'.$i] = $set[$field];
|
||||
$bound[':insert_'.$field.'_'.$i] = $set[$field];
|
||||
|
||||
|
||||
/* [3] On exécute la requête et envoie le status
|
||||
=========================================================*/
|
||||
$inserted = $request->execute($binded);
|
||||
$inserted = $request->execute($bound);
|
||||
|
||||
// On retourne le status
|
||||
return $inserted;
|
||||
|
@ -647,7 +647,7 @@
|
|||
$requestS = [];
|
||||
|
||||
/* (2) On initialise les paramètres */
|
||||
$binded = [];
|
||||
$bound = [];
|
||||
|
||||
|
||||
/* [1] Clause DELETE FROM
|
||||
|
@ -664,9 +664,9 @@
|
|||
foreach($conditions as $cdt=>$value){
|
||||
|
||||
if( $value[1] == self::COND_IN ) // Si condition de type IN
|
||||
$requestS['WHERE'][$c] = SQLBuilder::IN([$this->schema['table'], $field], $value[0], $c, $binded);
|
||||
$requestS['WHERE'][$c] = SQLBuilder::IN([$this->schema['table'], $field], $value[0], $c, $bound);
|
||||
else // Sinon
|
||||
$requestS['WHERE'][$c] = SQLBuilder::WHERE([$this->schema['table'], $field], $value, $c, $binded);
|
||||
$requestS['WHERE'][$c] = SQLBuilder::WHERE([$this->schema['table'], $field], $value, $c, $bound);
|
||||
|
||||
$c++;
|
||||
}
|
||||
|
@ -691,7 +691,7 @@
|
|||
$requestS['WHERE'][] = $this->schema['table'].".$field in ($joinedRequest)";
|
||||
|
||||
// {6} On ajoute les variables à la requête courante //
|
||||
$binded = array_merge($binded, $joinedFetched['binded']);
|
||||
$bound = array_merge($bound, $joinedFetched['bound']);
|
||||
}
|
||||
|
||||
|
||||
|
@ -711,7 +711,7 @@
|
|||
/* [5] On exécute la requête et retourne le résultat
|
||||
=========================================================*/
|
||||
/* (1) On exécute la requête */
|
||||
$deleted = $request->execute($binded);
|
||||
$deleted = $request->execute($bound);
|
||||
|
||||
/* (2) On retourne l'état de la requête */
|
||||
return $deleted;
|
||||
|
@ -724,7 +724,7 @@
|
|||
|
||||
/* RETOURNE LES DONNEES / NULL si une erreur survient
|
||||
*
|
||||
* @execute<Boolean> VRAI si on veut exécuter la requête, sinon renvoie [requete, bindedParams]
|
||||
* @execute<Boolean> VRAI si on veut exécuter la requête, sinon renvoie [requete, boundParams]
|
||||
*
|
||||
* @return data<Array> Tableau contenant les champs sélectionnés
|
||||
* @return data<mixed> Valeur du champ sélectionné (si 1 seul champ)
|
||||
|
@ -738,7 +738,7 @@
|
|||
$requestS = [];
|
||||
|
||||
/* (2) On initialise le conteneur des variables "bindés" */
|
||||
$binded = [];
|
||||
$bound = [];
|
||||
|
||||
|
||||
|
||||
|
@ -786,7 +786,7 @@
|
|||
$requestS['FROM'][] = "($joinedRequest) as ".$data['object']->schema['table'];
|
||||
|
||||
// {6} On ajoute les variables à la requête courante //
|
||||
$binded = array_merge($binded, $joinedFetched['binded']);
|
||||
$bound = array_merge($bound, $joinedFetched['bound']);
|
||||
}
|
||||
|
||||
|
||||
|
@ -800,9 +800,9 @@
|
|||
foreach($conditions as $cdt=>$value){
|
||||
|
||||
if( $value[1] === self::COND_IN ) // Si condition IN
|
||||
$requestS['WHERE'][$c] = SQLBuilder::IN([$this->schema['table'], $field], $value[0], $c, $binded);
|
||||
$requestS['WHERE'][$c] = SQLBuilder::IN([$this->schema['table'], $field], $value[0], $c, $bound);
|
||||
else // Sinon
|
||||
$requestS['WHERE'][$c] = SQLBuilder::WHERE([$this->schema['table'], $field], $value, $c, $binded);
|
||||
$requestS['WHERE'][$c] = SQLBuilder::WHERE([$this->schema['table'], $field], $value, $c, $bound);
|
||||
|
||||
$c++;
|
||||
}
|
||||
|
@ -822,9 +822,9 @@
|
|||
|
||||
/* [7] On compose/prépare la requête
|
||||
=========================================================*/
|
||||
/* (1) Si on veut pas exécuter on renvoie la requête + bindedParams */
|
||||
/* (1) Si on veut pas exécuter on renvoie la requête + boundParams */
|
||||
if( !$execute )
|
||||
return [ 'request' => $requestS, 'binded' => $binded];
|
||||
return [ 'request' => $requestS, 'bound' => $bound];
|
||||
|
||||
/* (2) On compose la requête */
|
||||
$requestString = SQLBuilder::BUILD($requestS).';';
|
||||
|
@ -835,7 +835,7 @@
|
|||
/* [8] On exécute la requête et retourne le résultat
|
||||
=========================================================*/
|
||||
/* (1) On exécute la requête */
|
||||
$request->execute($binded);
|
||||
$request->execute($bound);
|
||||
|
||||
/* (2) Si unique */
|
||||
if( $this->unique )
|
||||
|
|
|
@ -92,12 +92,12 @@
|
|||
* @field<Array> Tableau contenant [table, field]
|
||||
* @array<Array> Valeurs de la clause IN
|
||||
* @offset<int> Permet de rendre la condition unique (nommage des variables)
|
||||
* @binded<Arary> Tableau associatif contenant les variables "bindés" -> ajout des champs
|
||||
* @bound<Arary> Tableau associatif contenant les variables "bindés" -> ajout des champs
|
||||
*
|
||||
* @return sql<String> Renvoie le textuel formatté
|
||||
*
|
||||
*/
|
||||
public static function IN($field, $array, $offset=0, &$binded){
|
||||
public static function IN($field, $array, $offset=0, &$bound){
|
||||
/* [0] Initialisation
|
||||
=========================================================*/
|
||||
$sql = '';
|
||||
|
@ -114,7 +114,7 @@
|
|||
|
||||
$sql .= ':'.$field[0].'_x_'.$field[1].'_'.$offset.'_'.$i;
|
||||
|
||||
$binded[':'.$field[0].'_x_'.$field[1].'_'.$offset.'_'.$i] = $value;
|
||||
$bound[':'.$field[0].'_x_'.$field[1].'_'.$offset.'_'.$i] = $value;
|
||||
|
||||
$c++;
|
||||
}
|
||||
|
@ -131,12 +131,12 @@
|
|||
* @field<Array> Tableau contenant [table, field]
|
||||
* @valeur<Array> Valeurs de la clause WHERE [valeur, opérateur]
|
||||
* @offset<int> Permet de rendre la condition unique (nommage des variables)
|
||||
* @binded<Arary> Tableau associatif contenant les variables "bindés" -> ajout des champs
|
||||
* @bound<Arary> Tableau associatif contenant les variables "bindés" -> ajout des champs
|
||||
*
|
||||
* @return sql<String> Renvoie le textuel formatté
|
||||
*
|
||||
*/
|
||||
public static function WHERE($field, $value, $offset=0, &$binded){
|
||||
public static function WHERE($field, $value, $offset=0, &$bound){
|
||||
/* [0] Initialisation
|
||||
=========================================================*/
|
||||
$sql = '';
|
||||
|
@ -153,7 +153,7 @@
|
|||
/* (3) Variable */
|
||||
$sql .= ':'.$field[0].'_x_'.$field[1].'_'.$offset;
|
||||
|
||||
$binded[':'.$field[0].'_x_'.$field[1].'_'.$offset] = $value[0];
|
||||
$bound[':'.$field[0].'_x_'.$field[1].'_'.$offset] = $value[0];
|
||||
|
||||
|
||||
return $sql;
|
||||
|
@ -166,12 +166,12 @@
|
|||
/* CONSTRUIT LA REQUETE FORMATTEE "SET" AVEC UNE LISTE DE TABLES
|
||||
*
|
||||
* @values<Array> Tableau de la forme [ field=>value, field2=>value2 ]
|
||||
* @binded<Arary> Tableau associatif contenant les variables "bindés" -> ajout des champs
|
||||
* @bound<Arary> Tableau associatif contenant les variables "bindés" -> ajout des champs
|
||||
*
|
||||
* @return sql<Array> Renvoie un tableau formatté
|
||||
*
|
||||
*/
|
||||
public static function SET($values, &$binded){
|
||||
public static function SET($values, &$bound){
|
||||
/* [0] Initialisation
|
||||
=========================================================*/
|
||||
$sql = [];
|
||||
|
@ -187,7 +187,7 @@
|
|||
/* (2) Variable */
|
||||
$sql[$c] .= ':update_'.$field;
|
||||
|
||||
$binded[':update_'.$field] = $value;
|
||||
$bound[':update_'.$field] = $value;
|
||||
|
||||
$c++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue