Hello,
I have a question about Database optimalisation.
I have a Dog (DO) that has a father and a mother. At the moment i have about 200 Dogs in my database, since every dog has a father and a mother i can build a pedigree...I have 2 options for this ( both working, that's not the problem )
option 1) In my template;
<% control MyDad %>
$PedigreeName
<% control MyDad %>
$PedigreeName
<% control MyDad %>
$PedigreeName
etc.etc.
<% end_control %>
<% end_control %>
<% end_control %>
Option 2 ) create functions in my DataObject Dog
function getMyDad(){
$father = dataObject::get_by_id('Dog', $this->MyFatherID);
return $father;
}
function getFather3()
{
$father3 = dataobject::get_by_id('Dog',$this->MyDad->MyFatherID);
return $father3;
}
function getFather7()
{
$father7 = dataObject::get_by_id('Dog',$this->Father3->MyFatherID);
return $father7;
}
etc etc.
Then i can use those in my template, filling out my table.
What is the most effective way to do this?
One other issue i'm having is that i need to compare every father/mother if they are already in the table since that could be inbred..
ps @Swaiba; Yes yes, still working on the thing ;)