[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 06/13: devient une classe abstraite
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 06/13: devient une classe abstraite |
Date: |
Sun, 09 Nov 2014 17:25:12 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 72d66765e660631142a158e7ebc964578b5cd481
Author: Dany De Bontridder <address@hidden>
Date: Sun Nov 9 18:09:01 2014 +0100
devient une classe abstraite
---
include/class_noalyss_sql.php | 30 ++++++++++--------------------
1 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/include/class_noalyss_sql.php b/include/class_noalyss_sql.php
index 51549c2..69bbbfd 100644
--- a/include/class_noalyss_sql.php
+++ b/include/class_noalyss_sql.php
@@ -22,8 +22,7 @@
/**
* @file
- * @brief
- * this wrapper is used to created easily a wrapper to a table
+ * @brief this wrapper is used to created easily a wrapper to a table
*
* @class
* Match a table into an object, you need to add the code for each table
@@ -70,7 +69,7 @@
* @endcode
*
*/
-class Noalyss_SQL
+abstract class Noalyss_SQL
{
function __construct(&$p_cn, $p_id=-1)
@@ -86,7 +85,7 @@ class Noalyss_SQL
}
$this->$pk=$p_id;
/* load it */
- $this->load();
+ if ($p_id != -1 )$this->load();
}
public function save()
@@ -100,8 +99,7 @@ class Noalyss_SQL
public function getp($p_string)
{
- if (array_key_exists($p_string, $this->name))
- {
+ if (array_key_exists($p_string, $this->name)) {
$idx=$this->name[$p_string];
return $this->$idx;
}
@@ -111,12 +109,10 @@ class Noalyss_SQL
public function setp($p_string, $p_value)
{
- if (array_key_exists($p_string, $this->name))
- {
+ if (array_key_exists($p_string, $this->name)) {
$idx=$this->name[$p_string];
$this->$idx=$p_value;
- }
- else
+ } else
throw new Exception(__FILE__.":".__LINE__.$p_string.'Erreur
attribut inexistant '.$p_string);
}
@@ -171,8 +167,7 @@ class Noalyss_SQL
$idx=1;
$array=array();
$set=" set ";
- foreach ($this->name as $key=> $value)
- {
+ foreach ($this->name as $key=> $value) {
if (isset($this->default[$value])&&$this->default[$value]=="auto")
continue;
switch ($this->type[$value])
@@ -198,11 +193,7 @@ class Noalyss_SQL
{
$sql=" select ";
$sep="";
- $par="";
-
- foreach ($this->name as $key)
- {
-
+ foreach ($this->name as $key) {
switch ($this->type[$key])
{
case "date":
@@ -217,7 +208,7 @@ class Noalyss_SQL
$sql.=" from ".$this->table;
$sql.=" where ".$this->primary_key." = $1";
-
+
$result=$this->cn->get_array($sql,array ($this->$pk));
if ($this->cn->count()==0)
{
@@ -315,7 +306,7 @@ class Noalyss_SQL
{
if ($p_array != null && ! is_array($p_array) )
{
- throw new Exception("Erreur : exec_sql attend un array");
+ throw new Exception(_("Erreur : exec_sql attend un array"));
}
$ret=$this->seek($cond, $p_array);
$max=Database::num_row($ret);
@@ -326,7 +317,6 @@ class Noalyss_SQL
}
return $a_return;
}
-
}
?>
- [Noalyss-commit] [noalyss] branch master updated (2a9161f -> edccfbe), Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 01/13: Task #145 - Amélioration stock Solde banque : agrandissement table, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 02/13: Task #1045 - Amélioration apparence : MENU : Menu verticaux différent, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 03/13: Task #1045 - Amélioration apparence : Ne montre pas échéance pour journaux financiers, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 04/13: Task #1045 - Amélioration apparence : Solde banque : agrandissement table, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 05/13: Ajout test paramètres passés, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 07/13: Task #1045 - Amélioration apparence : Icone enlever tag, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 06/13: devient une classe abstraite,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 08/13: Enleve global $cn, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 09/13: ajout à HTMLINPUT::anchor d'un style ou classe, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 12/13: Task #1045 - Amélioration apparence : Ajout symbole pour enlever tag, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 10/13: Ajout test paramètres passés, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 11/13: Task #1045 - Amélioration apparence : correction position fenêtre tag, Dany De Bontridder, 2014/11/09
- [Noalyss-commit] [noalyss] 13/13: Passage par reference de la connexion, Dany De Bontridder, 2014/11/09