Alternative ways to get Table-instance in doctrine

GFXRequest

New Member
In some circumstances \[code\]Doctrine_Core::getTable('%Name%')\[/code\] returns\[code\]Doctrine_Table\[/code\] instance instead of \[code\]%Name%Table\[/code\] one. It's obviously a bug, but are there other ways of getting Table-instances in doctrine besides \[code\]Doctrine_Core::getTable('%Name%')\[/code\] ?In order to give a demonstration of this improper behavior : here is schema of small issuetracking system\[code\]User: actAs: [Timestampable] tableName: issue_user columns: user_id: { type: integer, primary: true, autoincrement: true } user_name: { type: string(255) } user_role: { type: enum, values: [worker, dispatcher, manager] } managed_by: { type: integer } password: { type: string(32) } salt: { type: string(32) } relations: Manager: foreignAlias: Workers class: User local: managed_by foreign: user_id type: one foreignType: manyIssue: actAs: [Timestampable] columns: issue_id: { type: integer, primary: true, autoincrement: true } from_ceh: { type: string(255) } from_name: { type: string(255) } from_phone: { type: string(255) } from_location: { type: string(255) } comp_name: { type: string(255) } comp_serial: { type: string(255) } comp_os: { type: enum, values: [Win95, Win98, WinNT, WinME, Win2000, WinXP, Vista, Win7] } issue_title: { type: string(255) } comment: { type: string(255) } owner_id: { type: integer } is_executed: { type: bool } relations: Owner: onDelete: CASCADE foreignAlias: Issues class: User local: owner_id foreign: user_id type: one foreignType: many\[/code\]When I just call \[code\]Doctrine_Core::getTable('User')\[/code\] it returns \[code\]UserTable\[/code\]instance, but if I call it after such a query:\[code\]Doctrine_Query::create() ->select('u.user_id, ws.user_id, i.*') ->from('User u, u.Workers ws, ws.Issues i') ->where('u.user_id=', $manager_id) ->fetchArray();\[/code\]calling \[code\]Doctrine_Core::getTable('User')\[/code\] returns \[code\]Doctrine_Table\[/code\]instanceP.S. Doctrine 1.2.3
 
Back
Top