Hello everyone !
I have a class Commande extending ModelAdmin.
In Commande exists a nested DataObject called NumeroColis (1 field : 'Numero'). I'm using the wonderful DOManager to handle it and it's perfect.
BUT :
When clicking the "Search" button, to show all the existing Commandes, I'd like to add a column called Numeros and for each Commande, show a list of the recorded NumeroColis.
This is what I did in Commande.php :
public function getListeNumeros() {
$rawlist = DataObject::get('NumeroColis','CommandeID = '.$this->ID);
$nums = $rawlist->column('Numero');
$liste = implode(', ', $nums);
if (isset($liste)) {
return $liste;
} else {
return "Pas de colis";
}
}
static $summary_fields = array(
...
'ListeNumeros' => 'Numéros',
...
);
I get a Internal Server Error when clicking the Search button... and I spent a lot of time on this, so I decided to ask the great SStripe international community ! Anyone ?