Posted by Aggelos on 12/20/06 23:49
Hello, I am trying to develop a class that I will be able to maintain
my relationships dynamically.
For example I have the class employee and class company
an employ has a Foreign Key companyId which I name it $FK_companyId
What I am doing is in my constructor I define how I would like to treat
the relationships.
so:
class employee {
var $employeeId;
var $companyId;
var $FK_companyId;
function employee() {
$this->FK_companyId['onDelete'] = 'restrict';
$this->FK_companyId['onUpdate'] = 'recurse';
}
}
Thats just a thought and it is sort of working but not in every
occasion. I am not going to add the whole class as I just want to give
you an Idea of what I am thinking.
My question is if you know something that has allready been done and I
am not aware of and can be used to define the relationships and
maintain them.
Any Ideas of a class or development pattern to do something like that ?
How do you keep your referential integrity in a MySQL MyISAM table ?
Thank you guys, I know I am probably overcomplicating things but I want
to know if there is a common development pattern that's been used to do
that.
Angelos.
[Back to original message]
|