public function ADMIN_getGrade($droits) { \application\resonance2\debug\console::FunctionTrace(__FUNCTION__); if (is_null($this->grades) or is_null($this->numberGrades)) { $this->ADMIN_loadGrades(); } if (is_null($droits)) { $log = "Class: " . __CLASS__ . " Function: " . __FUNCTION__ . " <u>droits</u> is null"; \application\resonance2\debug\console::Alert($log); throw new \Exception($log); } $found = false; for ($i = 0; $i < $this->numberGrades; $i++) { if ($this->grades[$i]["TYPE"] == $droits) { $found = true; return $this->grades[$i]["TYPE"]; break; } elseif ($i == $this->numberGrades - 1 and $this->grades[$i]["TYPE"] != $droits and $found == false) { //If no match $log = "Class: " . __CLASS__ . " Function: " . __FUNCTION__ . " <u>droit</u> do not match any condition"; \application\resonance2\debug\console::Alert($log); throw new \Exception($log); } } }
public function SQLPDO_deleteTableRowWhereProprietyEqual($table, $propriety, $equal) { \application\resonance2\debug\console::FunctionTrace(__FUNCTION__); if (is_null($table)) { \application\resonance2\debug\console::Alert("Class: " . __CLASS__ . " Function: " . __FUNCTION__ . " table is null"); throw new \Exception("Class: " . __CLASS__ . " Function: " . __FUNCTION__ . " table is null"); } elseif (is_null($propriety)) { \application\resonance2\debug\console::Alert("Class: " . __CLASS__ . " Function: " . __FUNCTION__ . " propriety is null"); throw new \Exception("Class: " . __CLASS__ . " Function: " . __FUNCTION__ . " propriety is null"); } elseif (is_null($equal)) { \application\resonance2\debug\console::Alert("Class: " . __CLASS__ . " Function: " . __FUNCTION__ . " equal is null"); throw new \Exception("Class: " . __CLASS__ . " Function: " . __FUNCTION__ . " equal is null"); } else { try { \application\resonance2\application::SQLPDO_open_connection(); $rqt = \application\resonance2\application::SQLPDO_getPDO_object()->prepare("DELETE FROM `{$table}` WHERE `{$propriety}` = '{$equal}'"); $rqt->execute(); } catch (\PDOException $e) { \application\resonance2\debug\console::Trace($e); } } }