[TASK] Use instanceof comparison instead of string comparison 98/24398/2
authorBenjamin Serfhos <serfhos@gmail.com>
Wed, 2 Oct 2013 12:28:17 +0000 (14:28 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Sat, 5 Oct 2013 13:16:24 +0000 (15:16 +0200)
This allows the ViewHelper to render elements which are extending
the model.

Resolves: #52469
Releases: 6.2, 6.1, 6.0
Change-Id: If4b9b3019b44e38a5a25cb74ff993e572464bb9d
Reviewed-on: https://review.typo3.org/24398
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/beuser/Classes/ViewHelpers/SpriteIconForRecordViewHelper.php

index f2afbf8..81e9ee8 100755 (executable)
@@ -53,7 +53,7 @@ class SpriteIconForRecordViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\Abst
                if (method_exists($object, 'getIsDisabled')) {
                        $row['disable'] = $object->getIsDisabled();
                }
-               if ($table === 'be_users' && get_class($object) === 'TYPO3\\CMS\\Beuser\\Domain\\Model\\BackendUser') {
+               if ($table === 'be_users' && $object instanceof \TYPO3\CMS\Beuser\Domain\Model\BackendUser) {
                        $row['admin'] = $object->getIsAdministrator();
                }
                if (method_exists($object, 'getStartDateAndTime')) {
@@ -67,4 +67,4 @@ class SpriteIconForRecordViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\Abst
 
 }
 
-?>
\ No newline at end of file
+?>