Commit d8780833 authored by Denis S. Valdenaire's avatar Denis S. Valdenaire

appel de table en static dans record

parent fadcd735
......@@ -14,7 +14,6 @@ class Game extends Record {
public static $table = "lud_games";
public function __construct($id = 0) {
$this->table = "lud_games";
if (!$this->id) {
$this->id = $id;
}
......
......@@ -11,7 +11,6 @@ class Loan extends Record {
public function __construct($id = 0)
{
$this->table = "lud_loans";
if (!$this->id) {
$this->id = $id;
}
......
......@@ -6,7 +6,6 @@ class Membership_Type extends Record {
public static $table = "lud_membership_types";
public function __construct($id = 0) {
$this->table = "lud_membership_types";
if (!$this->id) {
$this->id = $id;
}
......
......@@ -6,7 +6,6 @@ class Payment_Method extends Record {
public static $table = "lud_payment_methods";
public function __construct($id = 0) {
$this->table = "lud_payment_methods";
if (!$this->id) {
$this->id = $id;
}
......
......@@ -25,7 +25,7 @@ class Record {
}
}
// SQL INSERT record.table
$sql = " INSERT INTO ".$this->table." (".$fields_sql." created_at, updated_at)
$sql = " INSERT INTO ".static::$table." (".$fields_sql." created_at, updated_at)
VALUES (".$datas_sql." now(), now())";
return $this->id = $GLOBALS["data"]->insert($sql);
}
......@@ -50,7 +50,7 @@ class Record {
}
if($update_sql != "") {
// SQL UPDATE record.table
$sql = " UPDATE ".$this->table." SET ".$update_sql." updated_at = now()
$sql = " UPDATE ".static::table." SET ".$update_sql." updated_at = now()
WHERE id = ".$this->id;
return $GLOBALS["data"]->update($sql);
} else {
......
......@@ -10,7 +10,6 @@ class Reservation extends Record {
public function __construct($id = 0)
{
$this->table = "lud_reservations";
if (!$this->id) {
$this->id = $id;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment