I know this has to have an easy answer, but I cannot figure it out. After tears, I am hoping someone here can help.
Here is my YML model:
Identity:
columns:
id:
type: integer(10)
primary: true
autoincrement: true
username:
type: string(255)
Profile:
columns:
id:
type: integer(10)
primary: true
autoincrement: true
identity_id:
type: integer(10)
profiletype_id:
type: integer(10)
name:
type: string(255)
relations:
Identity:
local: identity_id
foreign: id
class: Identity
foreignAlias: Profiles
Profiletype:
local: profiletype_id
foreign: id
class: Profiletype
foreignAlias: Profiles
Profiletype:
columns:
id:
type: integer(10)
primary: true
autoincrement: true
type:
type: string(255)
As you can see, 3 linked tables are generated:
Identity
- can have multiple Profiles
Profile
- has one Identity
- has one Profiletype
Profiletype
- can have multiple Profiles
Now, In my code, I can perform queries on the generated models for Identity and Profiletype.
For example:
$q = Doctrine_Query::create()
->select('i.*')
->from('Identity i');
echo $q->getSqlQuery();
will work and produce:
SELECT i.id AS i__id, i.username AS i__username FROM identity i
However, when I go to run any query on the Profile table, it will not work. Even a simple query such as
$q = Doctrine_Query::create()
->select('p.*')
->from('Profile p');
echo $q->getSqlQuery();
fails. I have tried changing the class name in the FROM to 'Profiles' instead of 'Profile'. Still nothing.
Any ideas on what I'm doing wrong.