diff --git a/src/extensions/DataObjectHistory.php b/src/extensions/DataObjectHistory.php index 69fef67..1fe715e 100644 --- a/src/extensions/DataObjectHistory.php +++ b/src/extensions/DataObjectHistory.php @@ -9,14 +9,15 @@ use SilverStripe\Forms\GridField\GridFieldPageCount; use SilverStripe\Forms\GridField\GridFieldToolbarHeader; use SilverStripe\Forms\GridField\GridFieldSortableHeader; -use Symbiote\GridFieldExtensions\GridFieldTitleHeader; use SilverStripe\Forms\GridField\GridFieldDetailForm; use SilverStripe\Forms\GridField\GridFieldDataColumns; use SilverStripe\Forms\GridField\GridFieldPaginator; use SilverStripe\Forms\GridField\GridFieldViewButton; +use SilverStripe\Security\Member; +use SilverStripe\Versioned\Versioned; +use Symbiote\GridFieldExtensions\GridFieldTitleHeader; use gorriecoe\DataObjectHistory\Forms\GridFieldHistoryButton; use gorriecoe\DataObjectHistory\Forms\HistoryGridFieldItemRequest; -use SilverStripe\Versioned\Versioned; /** * DataObjectHistory @@ -87,4 +88,16 @@ public function getHistoryFields() ->addExtraClass('grid-field--history') ); } + + /** + * @return Member + */ + public function getAuthor() + { + $owner = $this->owner; + if ($owner->AuthorID) { + return Member::get()->byId($owner->AuthorID); + } + return null; + } }