Affects Version/s: 1.2.1
Fix Version/s: 1.2.2
Environment:Symfony 1.3 with Doctrine 1.2 on Debian 5.0 Linux
I'm using the symfony framework but assume that the following only affects the classes that were auto generated by Doctrine.
When doctrine generates the model classes for e.g. the sql table "manage_users" it generates:
As far as I understand the ManageUsersTable class is supposed to be autoloaded by Doctrine (cf. ATTR_AUTOLOAD_TABLE_CLASSES) and injected into
the class returned by Doctrine::getTable('ManageUsers').
The first problem is that it is hard to figure out for newbies how to access methods in this class because they try all means to instanciate it or looking for static methods but eventually fail
The second problem is that using it this way, the IDE auto completion feature has no chance to figure out that the returned object offers methods defined in ManageUsersTable.class.php, it can only know that the results is an instance of Doctrine_Table.
The third problem is that one has to repeatingly write Doctrine::getTable("ManageUser") in the source code which is quite error prone - or did you notice that I missed an "s" in the example just given The IDE has again no chance to spot this.
A simple solution to all problems would be an auto generated getInstance method like this:
This way one could write ManageUs<AUTOCOMPLETION>::getInstance()->get<AUTOCOMPLETION>(); and there would be far less typo bugs!