Noalyss_SQL add function get_pk_value for getting the

value of the PK
This commit is contained in:
Dany De Bontridder 2017-01-10 20:28:26 +01:00
parent b9c2ad9af0
commit 3483fd2664

View file

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