Skip to content

Commit

Permalink
using hasmethod instead of method_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Thaleikis committed Sep 14, 2015
1 parent 8a9e075 commit 9a253f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/GridFieldExternalLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function getColumnsHandled($gridField) {
*/
public function getColumnContent($gridField, $record, $columnName) {
$data = new ArrayData(array(
'Link' => method_exists($record, 'getExternalLink') ? $record->getExternalLink() : $record->ExternalLink
'Link' => $record->hasMethod('getExternalLink') ? $record->getExternalLink() : $record->ExternalLink
));

return $data->renderWith('GridFieldExternalLink');
Expand Down

0 comments on commit 9a253f2

Please sign in to comment.