[ BUG ] Models with underscores
Hi,
I have a DB table access_log, and a corresponding model Access_Log. When I call save() on Access_Log, I get the exception:
Table "access__log" doesn't exist on database when dumping meta-data for App\Access_Log
Note: Access_Log is namespaced in App
Note also that the inferred table name has 2 underscores.
However, if I define the getSource() method thusly:
public function getSource(){
return 'access_log';
}
Everything works fine.
Your model should be called AccessLog, without the underscore. It's the convention.
Ah yes, I see the documentation now. I'm not going to close this though, as I wonder if this should be mentioned in the documentation somehow - just how Phalcon determines the table name to map a model to.
Open the issue in the docs repo: https://github.com/phalcon/docs
phalcon/docs#143