mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Test dynamic summary_fields
This commit is contained in:
parent
52e8bc13a7
commit
b928d641ee
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user