* Return the GUID of the owner of this object.
*
* @return int
- * @deprecated 1.8 Use getOwner() instead
+ * @deprecated 1.8 Use getOwnerGUID() instead
*/
public function getObjectOwnerGUID() {
- elgg_deprecated_notice("getObjectOwnerGUID() was deprecated. Use getOwner().", 1.8);
+ elgg_deprecated_notice("getObjectOwnerGUID() was deprecated. Use getOwnerGUID().", 1.8);
return $this->owner_guid;
}
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 {
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]))) {
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);
return true;
}
+ /**
+ * Get the GUID of the extender's owner entity.
+ *
+ * @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("ElggExtender::getOwner deprecated for ElggExtender::getOwnerGUID", 1.8);
+ return $this->getOwnerGUID();
}
/**
- * Returns the ElggEntity or child object of the owner of the entity.
+ * Get the entity that owns this extender
*
- * @return ElggEntity The owning user
+ * @return ElggEntity
*/
public function getOwnerEntity() {
return get_entity($this->owner_guid);
}
/**
- * Return the entity this describes.
+ * Get the entity this describes.
*
- * @return ElggEntity The enttiy
+ * @return ElggEntity The entity
*/
public function getEntity() {
return get_entity($this->entity_guid);
}
/**
- * If a user's owner is blank, return its own GUID as the owner
+ * Get a user's owner GUID
*
- * @return int User GUID
+ * Returns it's own GUID if the user is not owned.
+ *
+ * @return int
*/
- function getOwner() {
+ function getOwnerGUID() {
if ($this->owner_guid == 0) {
- return $this->getGUID();
+ return $this->guid;
}
return $this->owner_guid;
}
+ /**
+ * If a user's owner is blank, return its own GUID as the owner
+ *
+ * @return int User GUID
+ * @deprecated 1.8 Use getOwnerGUID()
+ */
+ function getOwner() {
+ elgg_deprecated_notice("ElggUser::getOwner deprecated for ElggUser::getOwnerGUID", 1.8);
+ $this->getOwnerGUID();
+ }
+
// EXPORTABLE INTERFACE ////////////////////////////////////////////////////////////
/**
* Return the GUID of the owner of this object.
*
* @return int
- * @deprecated 1.8 Use getOwner() instead
+ * @deprecated 1.8 Use getOwnerGUID() instead
*/
public function getObjectOwnerGUID();
}
\ No newline at end of file
// Test user if possible - should default to false unless a plugin hook says otherwise
if ($user) {
- if ($entity->getOwner() == $user->getGUID()) {
+ if ($entity->getOwnerGUID() == $user->getGUID()) {
$return = true;
}
if ($entity->container_guid == $user->getGUID()) {
}
// If the owner is the specified user, great! They can edit.
- if ($extender->getOwner() == $user->getGUID()) {
+ if ($extender->getOwnerGUID() == $user->getGUID()) {
return true;
}
$this->assertIdentical($this->entity->getGUID(), $this->entity->guid );
$this->assertIdentical($this->entity->getType(), $this->entity->type );
$this->assertIdentical($this->entity->getSubtype(), $this->entity->subtype );
- $this->assertIdentical($this->entity->getOwner(), $this->entity->owner_guid );
+ $this->assertIdentical($this->entity->getOwnerGUID(), $this->entity->owner_guid );
$this->assertIdentical($this->entity->getAccessID(), $this->entity->access_id );
$this->assertIdentical($this->entity->getTimeCreated(), $this->entity->time_created );
$this->assertIdentical($this->entity->getTimeUpdated(), $this->entity->time_updated );
// Make sure we actually have permission to edit
$topic = get_entity($topic_guid);
if ($topic){
- $user = $topic->getOwner();
+ $user = $topic->getOwnerGUID();
if ($topic->getSubtype() == "groupforumtopic") {
// Convert string of tags into a preformatted array
if (($user instanceof ElggUser) && ($group instanceof ElggGroup))
{
- if ($group->getOwner() != get_loggedin_userid()) {
+ if ($group->getOwnerGUID() != get_loggedin_userid()) {
if ($group->leave($user))
system_message(elgg_echo("groups:left"));
else
if ($thewire->getSubtype() == "thewire" && $thewire->canEdit()) {
// Get owning user
- $owner = get_entity($thewire->getOwner());
+ $owner = $thewire->getOwnerEntity();
// Delete it!
$rowsaffected = $thewire->delete();
if ($rowsaffected > 0) {