noalyss-commit
[Top][All Lists]
Advanced

[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()
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]