delete ok

This commit is contained in:
fredtempez 2022-02-25 08:42:00 +01:00
parent 63f94e321f
commit 7ce2d60b50

View File

@ -438,29 +438,13 @@ class common {
// Descripteur // Descripteur
$db = $this->dataFiles[$keys[0]]; $db = $this->dataFiles[$keys[0]];
// Aiguillage // Aiguillage
switch(count($keys)) { $result = false;
case 1: $result = $keys[0];
$db->delete($keys[0], true); for ($i=1; $i <= count($keys) -1 ; $i++) {
break; echo $i;
case 2: $result .= '.' . $keys[$i];
$db->delete($keys[0].'.'.$keys[1],true);
break;
case 3:
$db->delete($keys[0].'.'.$keys[1].'.'.$keys[2], true);
break;
case 4:
$db->delete($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3], true);
break;
case 5:
$db->delete($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4], true);
break;
case 6:
$db->delete($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5], true);
break;
case 7:
$db->delete($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5].'.'.$keys[6], true);
break;
} }
$success = is_object ($db->delete($result, $keys[count($keys)], true));
} }
/** /**
@ -483,11 +467,9 @@ class common {
$success = false; $success = false;
$db = $this->dataFiles[$keys[0]]; $db = $this->dataFiles[$keys[0]];
if (count($keys) >= 1) { if (count($keys) >= 1) {
/**
* Lecture directe
*/
$db = $this->dataFiles[$keys[0]]; $db = $this->dataFiles[$keys[0]];
$result = $keys[0]; $result = $keys[0];
// Ne pas tenir compte du dernier élément qui une une value donc <
for ($i=1; $i < count($keys)-1 ; $i++) { for ($i=1; $i < count($keys)-1 ; $i++) {
$result .= '.' . $keys[$i]; $result .= '.' . $keys[$i];
} }