From 7e54b4efb86eecf550c23aa21146d7e191a2da0e Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sun, 31 Oct 2010 20:34:59 +0000 Subject: Refs #2597: Pushed getOwner and getOwnerEntity into ElggEntity and ElggExtender git-svn-id: http://code.elgg.org/elgg/trunk@7172 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggEntity.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'engine/classes/ElggEntity.php') diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index 2128a35e9..ea2c52c22 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -704,6 +704,24 @@ abstract class ElggEntity extends ElggData implements return get_subtype_from_id($this->get('subtype')); } + /** + * 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->owner_guid); + } + /** * Returns the UNIX epoch time that this entity was last updated * -- cgit v1.2.3