aboutsummaryrefslogtreecommitdiffstats
path: root/MainController.php
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2011-03-30 16:35:19 +0300
committerFilipp Lepalaan <filipp@mac.com>2011-03-30 16:35:19 +0300
commitf5cb46d5ffa5c46d4b1aa176d9104e8dd67b24ae (patch)
treeda5acaed70c97a00c2efbbc6bd617a840c685864 /MainController.php
parent914599c7c2a50c8f1439189214184a2a0f402fc8 (diff)
downloadmain-f5cb46d5ffa5c46d4b1aa176d9104e8dd67b24ae.tar.gz
main-f5cb46d5ffa5c46d4b1aa176d9104e8dd67b24ae.tar.bz2
main-f5cb46d5ffa5c46d4b1aa176d9104e8dd67b24ae.zip
better
Diffstat (limited to 'MainController.php')
-rw-r--r--[-rwxr-xr-x]MainController.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/MainController.php b/MainController.php
index 7b6012e..49a60b5 100755..100644
--- a/MainController.php
+++ b/MainController.php
@@ -2,13 +2,6 @@
////
// main/MainController.php
// @TODO: transfer boeuf.php here
-
-/* This program is free software. It comes without any warranty, to
- * the extent permitted by applicable law. You can redistribute it
- * and/or modify it under the terms of the Do What The Fuck You Want
- * To Public License, Version 2, as published by Sam Hocevar. See
- * http://sam.zoy.org/wtfpl/COPYING for more details. */
-
class MainController
{
public $view; // Where to store the data to be rendered
@@ -224,10 +217,11 @@ class MainController
`{$table}_{$this->table}`.`{$table}_id` = `$table`.id AND
`{$this->table}`.id = ?";
} else if (@in_array($table, $ref_schema['belongsTo'])) { // 1/m
- $sql = "SELECT * FROM `$ref` WHERE `$ref`.`{$table}_id` = ?";
+ $sql = "SELECT * FROM `$ref` WHERE `$ref`.`{$table}_id` = ?";
}
$stmt = MainDb::query($sql, array($id));
+
if (!$stmt) {
return MainApp::error('Error executing query ' . $sql);
}
@@ -330,7 +324,8 @@ class MainController
////
// update this Thing
// We keep this in the Controller since it might know
- // more about the topmost class
+ // more about the topmost class
+ // return the updated Thing
protected function update($data, $where = NULL)
{
if (!is_array($data)) {