Thanks for your help, however I still do not get it working. Maybe I am referencing wrong. I will give some more details of the situation at hand:
Profile.php
class Profile extends Page {
}
class Profile_Controller extends Page_Controller {
function CurrentSubscriptions() {
// s11s = s ubscription s
$cMember = Member::currentUserID();
$s11s = DataObject::get("DanceCouples","PartnerAID = {$cMember} OR PartnerBID = {$cMember}");
return $s11s;
}
}
Than I have the following code that creates the Model for the couples of persons:
class DanceCouples extends DataObject {
static $db = array(
'DansNiveau' => "Int"
);
// Een lid kan meerdere koppels vormen
static $has_one = array(
'PartnerA' => 'DanceMemberInfo',
'PartnerB' => 'DanceMemberInfo'
);
And the following Model for 'DanceMemberInfo':
class DanceMemberInfo extends Member {
static $db = array(
'Voorletters' => 'Varchar',
'Geslacht' => "Enum('m,v')",
'Adres' => 'Varchar',
'Postcode' => 'Varchar',
'Plaats' => 'Varchar',
'Telefoon' => 'Varchar',
'XtraCardNr' => 'Varchar'
);
// Meerdere dansniveaus per lid toegestaan
static $has_many = array(
'DanceCouples' => 'DanceCouples',
);
}
The IDs which 'DansNiveau' refers to are created here:
class DanceCourses extends DataObject {
static $db = array(
'Name' => 'Varchar'
);
}
Is this a proper way of creating a model, so I can read all data to the template? How can I reference to it? I tried using the advanced-template reference of SS, but it did not help for me. Could you maybe give some suggestions?
Thanks a lot!
Maurice