From 944b8f89b8dd87bf444503d0815aa69ed19f599d Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 20 Nov 2010 13:31:46 +0000 Subject: Fixes #2668 adding getOwnerGUID() git-svn-id: http://code.elgg.org/elgg/trunk@7378 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggEntity.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'engine/classes/ElggEntity.php') diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index 667302c30..de57d7a07 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -297,7 +297,7 @@ abstract class ElggEntity extends ElggData implements if ((int) $this->guid > 0) { $multiple = true; if (!create_metadata($this->getGUID(), $name, $v, $value_type, - $this->getOwner(), $this->getAccessID(), $multiple)) { + $this->getOwnerGUID(), $this->getAccessID(), $multiple)) { return false; } } else { @@ -320,7 +320,7 @@ abstract class ElggEntity extends ElggData implements unset($this->temp_metadata[$name]); if ((int) $this->guid > 0) { $result = create_metadata($this->getGUID(), $name, $value, $value_type, - $this->getOwner(), $this->getAccessID(), $multiple); + $this->getOwnerGUID(), $this->getAccessID(), $multiple); return (bool)$result; } else { if (($multiple) && (isset($this->temp_metadata[$name]))) { @@ -704,19 +704,30 @@ abstract class ElggEntity extends ElggData implements return get_subtype_from_id($this->get('subtype')); } + /** + * Get the guid of the entity's owner. + * + * @return int The owner GUID + */ + public function getOwnerGUID() { + return $this->owner_guid; + } + /** * Return the guid of the entity's owner. * * @return int The owner GUID + * @deprecated 1.8 Use getOwnerGUID() */ public function getOwner() { - return $this->owner_guid; + elgg_deprecated_notice("ElggEntity::getOwner deprecated for ElggEntity::getOwnerGUID", 1.8); + return $this->getOwnerGUID(); } /** - * Returns the ElggEntity or child object of the owner of the entity. + * Gets the ElggEntity that owns this entity. * - * @return ElggEntity The owning user + * @return ElggEntity The owning entity */ public function getOwnerEntity() { return get_entity($this->owner_guid); -- cgit v1.2.3