[CLEANUP] Rename AbstractContentObject::getContentObject() 72/42272/12
authorAndreas Wolf <andreas.wolf@typo3.org>
Fri, 4 Mar 2016 11:56:06 +0000 (12:56 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sun, 6 Mar 2016 00:16:27 +0000 (01:16 +0100)
The method is renamed to getContentObjectRenderer(), as this better
reflects what it actually does. The old method is marked as deprecated
and scheduled for removal in v9.

Change-Id: Idaaba8856f7cca31bdc1d5c301a221dee2059048
Resolves: #68748
Releases: master
Reviewed-on: https://review.typo3.org/42272
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-68748-DeprecateAbstractContentObjectgetContentObject.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/ContentObject/AbstractContentObject.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-68748-DeprecateAbstractContentObjectgetContentObject.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-68748-DeprecateAbstractContentObjectgetContentObject.rst
new file mode 100644 (file)
index 0000000..669f21b
--- /dev/null
@@ -0,0 +1,15 @@
+=========================================================================
+Deprecation: #68748 - Deprecate AbstractContentObject::getContentObject()
+=========================================================================
+
+Description
+===========
+
+The method is renamed to getContentObjectRenderer(). The old method name is still present as a
+deprecated alias, which will be removed in TYPO3 v10.
+
+
+Impact
+======
+
+All method calls to getContentObject() must be changed to getContentObjectRenderer() until TYPO3 v9.
index 120b2b1..4fd1eb9 100644 (file)
@@ -51,12 +51,24 @@ abstract class AbstractContentObject
     abstract public function render($conf = array());
 
     /**
-     * Getter for current cObj
+     * Getter for current ContentObjectRenderer
      *
      * @return ContentObjectRenderer
+     * @deprecated since TYPO3 v8, will be removed with TYPO3 v9. Use getContentObjectRenderer() instead.
      */
     public function getContentObject()
     {
+        GeneralUtility::logDeprecatedFunction();
+        return $this->getContentObjectRenderer();
+    }
+
+    /**
+     * Getter for current ContentObjectRenderer
+     *
+     * @return ContentObjectRenderer
+     */
+    public function getContentObjectRenderer()
+    {
         return $this->cObj;
     }
 
index c4c3727..479a0d8 100644 (file)
@@ -99,7 +99,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function constructSetsContentObjectRenderer()
     {
-        $this->assertSame($this->contentObjectRenderer, $this->subject->getContentObject());
+        $this->assertSame($this->contentObjectRenderer, $this->subject->getContentObjectRenderer());
     }
 
     /**