diff options
author | Filipp Lepalaan <filipp@mac.com> | 2010-03-02 13:11:20 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2010-03-02 13:11:20 +0200 |
commit | a78ac287043f57ea81e1175ffbe2476956e04752 (patch) | |
tree | 8aabdc32737c4ab23835b75b25d2c0fed5b58fb2 /Controller.php | |
parent | eed0004987179f1dd4e70f9f8e7d7e7c2b805865 (diff) | |
download | main-a78ac287043f57ea81e1175ffbe2476956e04752.tar.gz main-a78ac287043f57ea81e1175ffbe2476956e04752.tar.bz2 main-a78ac287043f57ea81e1175ffbe2476956e04752.zip |
Some cleanup
Diffstat (limited to 'Controller.php')
-rw-r--r-- | Controller.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Controller.php b/Controller.php index dbe5e06..2534397 100644 --- a/Controller.php +++ b/Controller.php @@ -207,7 +207,7 @@ class Controller foreach ($fk as $parent) { - $fkey = "id"; + $fkey = 'id'; $lkey = "{$parent}_id"; /* if ($this->schema['foreignKey'][$parent]) @@ -245,15 +245,15 @@ class Controller /** * Insert this thing in the DB and return inserted - * thing + * Thing */ public function insert($data) { if (empty($data)) { - return App::error("Nothing to insert"); + return App::error('Cannot insert emptiness'); } - $insert = ""; + $insert = ''; $values = array(); foreach($data as $k => $v) @@ -262,8 +262,8 @@ class Controller $values[":{$k}"] = $v; } - $insert = rtrim($insert, ", "); - $val = implode(", ", array_keys($values)); + $insert = rtrim($insert, ', '); + $val = implode(', ', array_keys($values)); $sql = "INSERT INTO `{$this->table}` ({$insert}) VALUES ({$val})"; return DB::query($sql, $values); @@ -271,12 +271,12 @@ class Controller } /** - * Delete this thing + * Delete This Thing */ - protected function delete($where, $limit = "") + protected function delete($where, $limit = '') { if (empty($where)) { - return App::error("Delete without arguments"); + return App::error('Cannot delete without arguments'); } list($key, $value) = each($where); @@ -293,14 +293,14 @@ class Controller } /** - * Update this thing + * Update this Thing * We keep this in the Controller since it might know * more about the topmost class */ protected function update($data, $where = null) { if (!is_array($data)) { - return App::error("Update with empty parameters"); + return App::error('Cannot update without parameters'); } if (empty($where)) { |