[~TASK] Extbase (Domain): Changed property usergroups to usergroup (FrontendUser...
authorJochen Rau <j.rau@web.de>
Tue, 15 Sep 2009 14:10:53 +0000 (14:10 +0000)
committerJochen Rau <j.rau@web.de>
Tue, 15 Sep 2009 14:10:53 +0000 (14:10 +0000)
typo3/sysext/extbase/Classes/Domain/Model/FrontendUser.php
typo3/sysext/extbase/Classes/Domain/Model/FrontendUserGroup.php
typo3/sysext/extbase/ext_typoscript_setup.txt

index 1dfbcfc..b08a63e 100644 (file)
@@ -46,7 +46,7 @@ class Tx_Extbase_Domain_Model_FrontendUser extends Tx_Extbase_DomainObject_Abstr
        /**
         * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup>
         */
-       protected $usergroups;
+       protected $usergroup;
 
        /**
         * @var string
@@ -131,7 +131,7 @@ class Tx_Extbase_Domain_Model_FrontendUser extends Tx_Extbase_DomainObject_Abstr
        public function __construct($username = '', $password = '') {
                $this->username = $username;
                $this->password = $password;
-               $this->usergroups = new Tx_Extbase_Persistence_ObjectStorage();
+               $this->usergroup = new Tx_Extbase_Persistence_ObjectStorage();
        }
 
        /**
@@ -177,14 +177,15 @@ class Tx_Extbase_Domain_Model_FrontendUser extends Tx_Extbase_DomainObject_Abstr
        }
 
        /**
-        * Sets the usergroups
+        * Sets the usergroups. Keep in mind that the property is called "usergroup"
+        * although it can hold several usergroups.
         *
-        * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup> $usergroups An object storage containing the usergroups to add
+        * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup> $usergroup An object storage containing the usergroups to add
         * @return void
         * @api
         */
-       public function setUsergroups(Tx_Extbase_Persistence_ObjectStorage $usergroups) {
-               $this->usergroups = $usergroups;
+       public function setUsergroup(Tx_Extbase_Persistence_ObjectStorage $usergroup) {
+               $this->usergroup = $usergroup;
        }
 
        /**
@@ -195,7 +196,7 @@ class Tx_Extbase_Domain_Model_FrontendUser extends Tx_Extbase_DomainObject_Abstr
         * @api
         */
        public function addUsergroup(Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup) {
-               $this->usergroups->attach($usergroup);
+               $this->usergroup->attach($usergroup);
        }
 
        /**
@@ -206,17 +207,18 @@ class Tx_Extbase_Domain_Model_FrontendUser extends Tx_Extbase_DomainObject_Abstr
         * @api
         */
        public function removeUsergroup(Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup) {
-               $this->usergroups->detach($usergroup);
+               $this->usergroup->detach($usergroup);
        }
 
        /**
-        * Returns the usergroups
+        * Returns the usergroups. Keep in mind that the property is called "usergroup"
+        * although it can hold several usergroups.
         *
-        * @return Tx_Extbase_Persistence_ObjectStorage An object storage containing the usergroups
+        * @return Tx_Extbase_Persistence_ObjectStorage An object storage containing the usergroup
         * @api
         */
        public function getUsergroups() {
-               return $this->usergroups;
+               return $this->usergroup;
        }
 
        /**
index baec2aa..b60a6f5 100644 (file)
@@ -51,14 +51,14 @@ class Tx_Extbase_Domain_Model_FrontendUserGroup extends Tx_Extbase_DomainObject_
        /**
         * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup>
         */
-       protected $subgroups;
+       protected $subgroup;
 
        /**
         * Constructs a new Frontend User Group
         *
         */
        public function __construct($title) {
-               $this->subgroups = new Tx_Extbase_Persistence_ObjectStorage();
+               $this->subgroup = new Tx_Extbase_Persistence_ObjectStorage();
        }
 
        /**
@@ -125,14 +125,15 @@ class Tx_Extbase_Domain_Model_FrontendUserGroup extends Tx_Extbase_DomainObject_
        }
 
        /**
-        * Sets the subgroups
+        * Sets the subgroups. Keep in mind that the property is called "subgroup"
+        * although it can hold several subgroups.
         *
-        * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup> $subgroups An object storage containing the subgroups to add
+        * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup> $subgroup An object storage containing the subgroups to add
         * @return void
         * @api
         */
-       public function setSubgroups(Tx_Extbase_Persistence_ObjectStorage $subgroups) {
-               $this->subgroups = $subgroups;
+       public function setSubgroup(Tx_Extbase_Persistence_ObjectStorage $subgroup) {
+               $this->subgroup = $subgroups;
        }
 
        /**
@@ -143,7 +144,7 @@ class Tx_Extbase_Domain_Model_FrontendUserGroup extends Tx_Extbase_DomainObject_
         * @api
         */
        public function addSubgroup(Tx_Extbase_Domain_Model_FrontendUserGroup $subgroup) {
-               $this->subgroups->attach($subgroup);
+               $this->subgroup->attach($subgroup);
        }
 
        /**
@@ -154,16 +155,17 @@ class Tx_Extbase_Domain_Model_FrontendUserGroup extends Tx_Extbase_DomainObject_
         * @api
         */
        public function removeSubgroup(Tx_Extbase_Domain_Model_FrontendUserGroup $subgroup) {
-               $this->subgroups->detach($subgroup);
+               $this->subgroup->detach($subgroup);
        }
 
        /**
-        * Returns the subgroups
+        * Returns the subgroups. Keep in mind that the property is called "subgroup"
+        * although it can hold several subgroups.
         *
         * @return Tx_Extbase_Persistence_ObjectStorage An object storage containing the subgroups
         * @api
         */
-       public function getSubgroups() {
+       public function getSubgroup() {
                return $this->subgroups;
        }
 
index f9a44e6..8f31ee5 100644 (file)
@@ -6,7 +6,6 @@ config.tx_extbase {
                                        tableName = fe_users
                                        columns {
                                                usergroup.foreignClass = Tx_Extbase_Domain_Model_FrontendUserGroup
-                                               usergroup.mapOnProperty = usergroups
                                                lockToDomain.mapOnProperty = lockToDomain
                                        }
                                }
@@ -16,7 +15,6 @@ config.tx_extbase {
                                        tableName = fe_groups
                                        columns {
                                                subgroup.foreignClass = Tx_Extbase_Domain_Model_FrontendUserGroup
-                                               subgroup.mapOnProperty = subgroups
                                                lockToDomain.mapOnProperty = lockToDomain
                                        }
                                }