aboutsummaryrefslogtreecommitdiffstats
path: root/Controller.php
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mekanisti.fi>2009-10-30 23:38:03 +0200
committerFilipp Lepalaan <filipp@mekanisti.fi>2009-10-30 23:38:03 +0200
commitefbacb9717eb28209c0362c84b293653915fb453 (patch)
tree0e3eb884dba9546c1845b3ce4ad9481fb4141d9d /Controller.php
parentbeadd930059012ddc6d055c09932227993305604 (diff)
downloadmain-efbacb9717eb28209c0362c84b293653915fb453.tar.gz
main-efbacb9717eb28209c0362c84b293653915fb453.tar.bz2
main-efbacb9717eb28209c0362c84b293653915fb453.zip
Fixes, updated readme
Diffstat (limited to 'Controller.php')
-rw-r--r--Controller.php6
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}";