{"action":"closed","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/10335","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10335/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10335/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10335/events","html_url":"https://github.com/phalcon/cphalcon/issues/10335","id":75809264,"number":10335,"title":"Phalcon 2 problem with model has special name","user":{"login":"nguyentrongbang","id":520273,"avatar_url":"https://avatars.githubusercontent.com/u/520273?v=3","gravatar_id":"","url":"https://api.github.com/users/nguyentrongbang","html_url":"https://github.com/nguyentrongbang","followers_url":"https://api.github.com/users/nguyentrongbang/followers","following_url":"https://api.github.com/users/nguyentrongbang/following{/other_user}","gists_url":"https://api.github.com/users/nguyentrongbang/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyentrongbang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyentrongbang/subscriptions","organizations_url":"https://api.github.com/users/nguyentrongbang/orgs","repos_url":"https://api.github.com/users/nguyentrongbang/repos","events_url":"https://api.github.com/users/nguyentrongbang/events{/privacy}","received_events_url":"https://api.github.com/users/nguyentrongbang/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-13T01:55:23Z","updated_at":"2015-05-13T17:11:38Z","closed_at":"2015-05-13T17:11:38Z","body":"I posted this in this link: http://forum.phalconphp.com/discussion/6703/table-prefix-without-getsource-method\r\n\r\nI have a problem which model since upgraded my application to phalcon 2.\r\n\r\nMy application has a model named \"Option\" (with table option).\r\n\r\nTable **`option`**:\r\n\r\n\tid\tint(11) Auto Increment\t \r\n    title\tvarchar(255)\t \r\n    key\tvarchar(255)\t \r\n    content\ttext NULL\r\n\r\nWith phalcon 1.3, function `getOption` below runs perfectly:\r\n\r\n\tpublic function getOption($key) {\r\n        $option = $this->function->get_result('option', 'findFirstByKey', $key);\r\n        if ($option) {\r\n            return array('status' => 'ok', 'data' => $option->toArray(), 'class' => 'option');\r\n        }\r\n\r\n        return array('status' => 'error', 'messages' => array('No record found'));\r\n    }\r\n\t\r\n\tpublic function get_class_name($class) {\r\n        $class_name = ucfirst($class);\r\n\r\n        return 'Bcdcnt\\Models\\\\' . $class_name;\r\n    }\r\n\r\n    public function get_result($class, $method, $args) {\r\n        $class_name = $this->get_class_name($class);\r\n\r\n        return call_user_func_array(array($class_name, $method), array($args));\r\n    }\r\n\t\r\nBut when switches to phalcon 2, the function return the error likes this:\r\n\r\n> SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option WHERE `option`.`key` = 'home_playlist_title' LIMIT 1' at line 1\r\n\r\nDoes the special model name (option) cause the error above?"}}