diff --git a/code/Company.php b/code/Company.php index d5dcd20..8b987f9 100644 --- a/code/Company.php +++ b/code/Company.php @@ -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();