[DC-860]  0 down vote favorite In some circumstances Doctrine_Core::getTable('%Name%') returns Doctrine_Table instance instead of %Name%Table one. Created: 06/Sep/10  Updated: 06/Sep/10

Status: Open
Project: Doctrine 1
Component/s: Relations
Affects Version/s: 1.2.3
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Hong Kil Dong Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 0
Labels: None
Environment:

WinXP, Apache, PHP 5.2.14



 Description   

In some circumstances Doctrine_Core::getTable('%Name%') returns Doctrine_Table instance instead of %Name%Table one.
So custom %Name%Table's methods become unavailable.

In order to give a demonstration of this improper behavior : here is a schema of small issue tracking system

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: many

Issue:
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

When I just call Doctrine_Core::getTable('User') it returns UserTable instance, but if I call it after such a query:

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();

calling Doctrine_Core::getTable('User') returns Doctrine_Table instance


Generated at Tue Nov 25 00:55:30 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.