From a8322c38312a86d0140d411be684194f3c0e1b47 Mon Sep 17 00:00:00 2001 From: aterekhov Date: Sun, 28 Feb 2010 21:34:08 +0000 Subject: [PATCH] Fixed wrong trimming for "model" from filename to receive tablename #0 git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@117 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- model/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/Model.php b/model/Model.php index ed3dd5b..5dfe6ae 100644 --- a/model/Model.php +++ b/model/Model.php @@ -128,8 +128,8 @@ abstract class Model public function table() { if (! $this->table) { - $this->table = rtrim(strtolower(get_class($this)), 'model'); + $this->table = substr(strtolower(get_class($this)), 0, -5/*strlen('Model')*/); } return $this->table; } -} \ No newline at end of file +}