]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2597: pulled getOwner and getOwnerEntity functions into ElggData
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 30 Oct 2010 23:59:40 +0000 (23:59 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 30 Oct 2010 23:59:40 +0000 (23:59 +0000)
I thought this would be OK even though relationships don't technically have owners because ElggRelationship implemented the getObectOwnerGUID method

git-svn-id: http://code.elgg.org/elgg/trunk@7156 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggData.php
engine/classes/ElggEntity.php
engine/classes/ElggExtender.php

index a206964faa64c1761a5044de65b6dc2407e410f0..b21646df1058ac003527f2ff96ba62b111c6b32d 100644 (file)
@@ -4,8 +4,23 @@ abstract class ElggData implements
        Iterator,       // Override foreach behaviour
        ArrayAccess // Override for array access
 {
-       
-       
+       /**
+        * Return the guid of the entity's owner.
+        *
+        * @return int The owner GUID
+        */
+       public function getOwner() {
+               return $this->owner_guid;
+       }
+
+       /**
+        * Returns the ElggEntity or child object of the owner of the entity.
+        *
+        * @return ElggEntity The owning user
+        */
+       public function getOwnerEntity() {
+               return get_entity($this->getOwner());
+       }
        
        /*
         *  SYSTEM LOG INTERFACE
index 9b6b048999f5435fa5160ec53f7b44c632d9a2b3..5d0e030fc24f9d0bc285460b0b8d88b7095497f7 100644 (file)
@@ -730,24 +730,6 @@ abstract class ElggEntity extends ElggData implements
                return $this->get('guid');
        }
 
-       /**
-        * Return the guid of the entity's owner.
-        *
-        * @return int The owner GUID
-        */
-       public function getOwner() {
-               return $this->get('owner_guid');
-       }
-
-       /**
-        * Returns the ElggEntity or child object of the owner of the entity.
-        *
-        * @return ElggEntity The owning user
-        */
-       public function getOwnerEntity() {
-               return get_entity($this->get('owner_guid'));
-       }
-
        /**
         * Returns the entity type
         *
index ca92dca748b48d84e80709379e947f56badda63b..2c2669e2819fb6fd9590b14bf2503da12214a1dc 100644 (file)
@@ -75,25 +75,6 @@ abstract class ElggExtender extends ElggData implements
                return true;
        }
 
-       /**
-        * Return the owner guid of this extender.
-        *
-        * @return int
-        */
-       public function getOwner() {
-               return $this->owner_guid;
-       }
-
-       /**
-        * Return the owner entity.
-        *
-        * @return ElggEntity|false
-        * @since 1.7.0
-        */
-       public function getOwnerEntity() {
-               return get_user($this->owner_guid);
-       }
-
        /**
         * Return the entity this describes.
         *