]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2668 adds getContainerGUID()
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 20 Nov 2010 13:42:32 +0000 (13:42 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 20 Nov 2010 13:42:32 +0000 (13:42 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7379 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggEntity.php
engine/tests/objects/objects.php

index de57d7a078ac3c59767c63ad528e7847ee5e071d..c6ab51148cea00e016d1711d40293c8833d39462 100644 (file)
@@ -747,21 +747,33 @@ abstract class ElggEntity extends ElggData implements
        }
 
        /**
-        * Returns the container GUID of this object.
+        * Gets the container GUID for this entity.
         *
         * @return int
         */
+       public function getContainerGUID() {
+               return $this->get('container_guid');
+       }
+
+       /**
+        * Gets the container GUID for this entity.
+        *
+        * @return int
+        * @deprecated 1.8 Use getContainerGUID()
+        */
        public function getContainer() {
+               elgg_deprecated_notice("ElggObject::getContainer deprecated for ElggEntity::getContainerGUID", 1.8);
                return $this->get('container_guid');
        }
 
        /**
-        * Returns the container entity for this object.
+        * Get the container entity for this object.
         *
         * @return ElggEntity
+        * @since 1.8.0
         */
        public function getContainerEntity() {
-               return get_entity($this->getContainer());
+               return get_entity($this->getContainerGUID());
        }
 
        /**
index 95f5076955f4a8f9d1ad280a196eee308a7d54e8..55734be13c487e73718959343f946d600ca0f462 100644 (file)
@@ -144,15 +144,15 @@ class ElggCoreObjectTest extends ElggCoreUnitTest {
        }
 
        public function testElggObjectContainer() {
-               $this->assertEqual($this->entity->getContainer(), get_loggedin_userid());
+               $this->assertEqual($this->entity->getContainerGUID(), get_loggedin_userid());
 
                // create and save to group
                $group = new ElggGroup();
                $guid = $group->save();
-               $this->assertTrue($this->entity->setContainer($guid));
+               $this->assertTrue($this->entity->setContainerGUID($guid));
 
                // check container
-               $this->assertEqual($this->entity->getContainer(), $guid);
+               $this->assertEqual($this->entity->getContainerGUID(), $guid);
                $this->assertIdentical($group, $this->entity->getContainerEntity());
 
                // clean up