diff options
author | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-30 23:38:03 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-30 23:38:03 +0200 |
commit | efbacb9717eb28209c0362c84b293653915fb453 (patch) | |
tree | 0e3eb884dba9546c1845b3ce4ad9481fb4141d9d /Controller.php | |
parent | beadd930059012ddc6d055c09932227993305604 (diff) | |
download | main-efbacb9717eb28209c0362c84b293653915fb453.tar.gz main-efbacb9717eb28209c0362c84b293653915fb453.tar.bz2 main-efbacb9717eb28209c0362c84b293653915fb453.zip |
Fixes, updated readme
Diffstat (limited to 'Controller.php')
-rw-r--r-- | Controller.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Controller.php b/Controller.php index 22dccc6..43b0efe 100644 --- a/Controller.php +++ b/Controller.php @@ -19,11 +19,14 @@ class Controller const TableName = ""; const TableSelect = ""; - function __construct() + function __construct($id = null) { // Child classes should always have the same name as their tables $this->table = strtolower(get_class($this)); $this->result = null; + if ($id) { + return $this->get($id); + } return $this; } @@ -254,6 +257,7 @@ class Controller } list($key, $value) = each($where); + $data = array(":{$key}" => $value); $sql = "DELETE FROM `{$this->table}` WHERE `{$key}` = :{$key}"; |