[BUGFIX] Remove property item of category model
authorAlexander Schnitzler <alex.schnitzler@typovision.de>
Wed, 21 Nov 2012 17:06:43 +0000 (18:06 +0100)
committerAlexander Schnitzler <typo3@alexanderschnitzler.de>
Wed, 21 Nov 2012 21:56:33 +0000 (22:56 +0100)
Because the mere presence of the property leads
to an SqlException in the Typo3DbBackend it has
to be removed for 6.0. For 6.1 a solution will
be found.

Releases: 6.0
Fixes: #43074
Change-Id: I35850ba3513c48da692f6e1a9d07e7cfbfd7f1b3
Reviewed-on: http://review.typo3.org/16673
Reviewed-by: Ingo Pfennigstorf
Tested-by: Ingo Pfennigstorf
Reviewed-by: Wouter Wolters
Reviewed-by: Alexander Schnitzler
Tested-by: Alexander Schnitzler
typo3/sysext/extbase/Classes/Domain/Model/Category.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/CategoryTest.php

index 0e86168..7ea8c09 100755 (executable)
@@ -49,29 +49,6 @@ class Category extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        protected $parent = NULL;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\DomainObject\AbstractEntity>
-        * @lazy
-        */
-       protected $items = NULL;
-
-       /**
-        * The constructor.
-        */
-       public function __construct() {
-               $this->initStorageObjects();
-       }
-
-       /**
-        * Initializes all \TYPO3\CMS\Extbase\Persistence\ObjectStorage properties.
-        *
-        * @return void
-        * @api
-        */
-       protected function initStorageObjects() {
-               $this->items = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-       }
-
-       /**
         * Gets the title.
         *
         * @return string the title, might be empty
@@ -136,49 +113,6 @@ class Category extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        public function setParent(\TYPO3\CMS\Extbase\Domain\Model\Category $parent) {
                $this->parent = $parent;
        }
-
-       /**
-        * Returns the items within this category.
-        *
-        * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage the items, might be empty
-        * @api
-        */
-       public function getItems() {
-               return $this->items;
-       }
-
-       /**
-        * Sets the items within this category.
-        *
-        * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $items
-        * @return void
-        * @api
-        */
-       public function setItems(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $items) {
-               $this->items = $items;
-       }
-
-       /**
-        * Adds a item to the items property
-        *
-        * @param \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $item
-        * @return void
-        * @api
-        */
-       public function addItem(\TYPO3\CMS\Extbase\DomainObject\AbstractEntity $item) {
-               $this->items->attach($item);
-       }
-
-       /**
-        * Removes a item of the items property
-        *
-        * @param \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $item
-        * @return void
-        * @api
-        */
-       public function removeItem(\TYPO3\CMS\Extbase\DomainObject\AbstractEntity $item) {
-               $this->items->detach($item);
-       }
 }
 
 ?>
\ No newline at end of file
index 488f97c..bd805d7 100644 (file)
@@ -88,44 +88,6 @@ class CategoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture->setParent($parent);
                $this->assertSame($parent, $this->fixture->getParent());
        }
-
-       /**
-        * @test
-        */
-       public function getItemsInitiallyReturnsEmptyStorage() {
-               $this->assertEquals(new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(), $this->fixture->getItems());
-       }
-
-       /**
-        * @test
-        */
-       public function setItemsSetsItems() {
-               $items = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $items->attach($this->getMockForAbstractClass('TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity'));
-               $this->fixture->setItems($items);
-               $this->assertEquals($items, $this->fixture->getItems());
-       }
-
-       /**
-        * @test
-        */
-       public function addItemAttachesItem() {
-               /** @var \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $item */
-               $item = $this->getMockForAbstractClass('TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity');
-               $this->fixture->addItem($item);
-               $this->assertTrue($this->fixture->getItems()->contains($item));
-       }
-
-       /**
-        * @test
-        */
-       public function removeItemDetachesItem() {
-               /** @var \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $item */
-               $item = $this->getMockForAbstractClass('TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity');
-               $this->fixture->addItem($item);
-               $this->fixture->removeItem($item);
-               $this->assertFalse($this->fixture->getItems()->contains($item));
-       }
 }
 
 ?>
\ No newline at end of file