From 368cc50361cfe6a4fc3d8eec976ce67e080a55b4 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sat, 30 Oct 2010 23:59:40 +0000 Subject: Refs #2597: pulled getOwner and getOwnerEntity functions into ElggData 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 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'engine/classes/ElggData.php') diff --git a/engine/classes/ElggData.php b/engine/classes/ElggData.php index a206964fa..b21646df1 100644 --- a/engine/classes/ElggData.php +++ b/engine/classes/ElggData.php @@ -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 -- cgit v1.2.3