I'm trying to write my first object oriented project in php, i've done oop before but it was a while back and it wasn't in web dev with a database model so it's a little different and i'm having trouble creating classes.
anyways, my problem is that i have this one object, let's call it x, x has an owner, y, so i have an instance of class person inside x, and owner y has an account, z.
so that all works fine, i can access x's owner information, and the owners account information just fine.
but i need to work both ways, i need to be able to look up an account, and then find the person who owns that account and all their x's.
cakephp can handle these relationships but i can't find any guides on how to write this kind of system myself.
thanks.
Zend Framework supports model relationships, its documentation is also quite extensive.
Typical scenario: