Hello,
I have some problems to show only a result list of a many_many-relation (without checkboxes and only the permission to 'show') with the DataObjectManager. I tried like this but it don't work. Can someone help me?
<?php
class BehandlungsListe extends DataObject {
static $db = array(
'Title' => 'Varchar(255)',
'Name_de' => 'Varchar(255)'
);
static $belongs_many_many = array(
'Anfragen' => 'Anfragen'
);
}
class Anfragen extends DataObject {
static $many_many = array(
'BehandlungsListe' => 'BehandlungsListe'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$AerzteTable = new DataObjectManager(
$this, 'BehandlungsListe', 'BehandlungsListe', null, null, "Anfragen_BehandlungsListe.AnfragenID = {$this->ID}");
$AerzteTable->setPermissions(array("show"));
$fields->addFieldToTab( 'Root.Main', $AerzteTable );
return $fields;
}
}
?>