Test dynamic summary_fields

This commit is contained in:
Ingo Schommer 2013-03-07 15:32:26 +01:00
parent 52e8bc13a7
commit b928d641ee

View File

@ -39,7 +39,20 @@ class Company extends DataObject {
'GridFieldTestPage' => 'GridFieldTestPage'
);
public static $summary_fields = array('Name', 'Category', 'Revenue', 'CEO');
public static $summary_fields = array(
'Name',
'Category',
'Revenue',
'CEO',
'DynamicProperty'
);
public static $searchable_fields = array(
'Name',
'Category',
'Revenue',
'CEO',
);
function validate() {
if(!$this->Title) {
@ -49,6 +62,10 @@ class Company extends DataObject {
}
}
public function DynamicProperty() {
return sprintf('%s (%s)', $this->Name, $this->CEO);
}
public function requireDefaultRecords() {
parent::requireDefaultRecords();