[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 108/151: Noalyss_SQL add function get_pk_valu
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 108/151: Noalyss_SQL add function get_pk_value for getting the value of the PK |
Date: |
Sat, 4 Feb 2017 17:14:32 +0000 (UTC) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 3483fd266417891c5b2fd953dabde7a14fa7abb5
Author: Dany De Bontridder <address@hidden>
Date: Tue Jan 10 20:28:26 2017 +0100
Noalyss_SQL add function get_pk_value for getting the
value of the PK
---
include/database/class_noalyss_sql.php | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/database/class_noalyss_sql.php
b/include/database/class_noalyss_sql.php
index 174a464..1ac6c3c 100644
--- a/include/database/class_noalyss_sql.php
+++ b/include/database/class_noalyss_sql.php
@@ -78,7 +78,7 @@ abstract class Noalyss_SQL
$pk=$this->primary_key;
$this->$pk=$p_id;
// check that the definition is correct
- if (count($this->name) != count($this->type) {
+ if (count($this->name) != count($this->type) ){
throw new Exception (__FILE__." $this->table Cannot
instantiate");
}
/* Initialize an empty object */
@@ -227,6 +227,16 @@ abstract class Noalyss_SQL
$sql.=" where ".$this->primary_key." = $".$idx;
$this->cn->exec_sql($sql, $array);
}
+ public function set_pk_value($p_value)
+ {
+ $pk=$this->primary_key;
+ $this->$pk=$p_value;
+ }
+ public function get_pk_value()
+ {
+ $pk=$this->primary_key;
+ return $this->$pk;
+ }
public function load()
{
- [Noalyss-commit] [noalyss] 94/151: Fix problem of accentuated char, (continued)
- [Noalyss-commit] [noalyss] 94/151: Fix problem of accentuated char, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 105/151: Noalyss_SQL Fix bug in set and get fct, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 103/151: Timestamp instead of date, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 90/151: Improve Acc_Bilan::warning, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 87/151: Performance : improve VERIF , Improve Accounting check, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 92/151: Fix config.inc.php : add carriage return, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 106/151: Merge branch 'master' of ns3:/srv/git/noalyss, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 85/151: Performance : improve VERIF , Affiche uniquement journaux incorrects, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 86/151: Performance : improve VERIF , Totaux Actif/Passif, Charge/Produit, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 102/151: Improve DOC for Scenario, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 108/151: Noalyss_SQL add function get_pk_value for getting the value of the PK,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 75/151: Scenario pour dév. de comptabilité analytique, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 70/151: sécurité Task #8 - Sécurité protection SQL, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 64/151: Clean code, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 79/151: PDF Operation ajout détail opération pour GrandLivre ANC , export des pièces avec tampon, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 81/151: syntax, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 88/151: remove debug info, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 93/151: Export PDF : check files properly, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 95/151: Problème htmlentities : charset par défaut différent entre version, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 91/151: Improve Performance Acc_Bilan::warning, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 104/151: Improve Noalyss_SQL : add set and get, Dany De Bontridder, 2017/02/04