diff options
-rw-r--r-- | engine/classes/ElggEntity.php | 31 | ||||
-rw-r--r-- | engine/classes/ElggObject.php | 37 |
2 files changed, 31 insertions, 37 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index ea2c52c22..ef38bee6b 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -721,6 +721,37 @@ abstract class ElggEntity extends ElggData implements public function getOwnerEntity() { return get_entity($this->owner_guid); } + + /** + * Set the container for this object. + * + * @param int $container_guid The ID of the container. + * + * @return bool + */ + public function setContainer($container_guid) { + $container_guid = (int)$container_guid; + + return $this->set('container_guid', $container_guid); + } + + /** + * Returns the container GUID of this object. + * + * @return int + */ + public function getContainer() { + return $this->get('container_guid'); + } + + /** + * Returns the container entity for this object. + * + * @return ElggEntity + */ + public function getContainerEntity() { + return get_entity($this->getContainer()); + } /** * Returns the UNIX epoch time that this entity was last updated diff --git a/engine/classes/ElggObject.php b/engine/classes/ElggObject.php index b8e733903..b721c479c 100644 --- a/engine/classes/ElggObject.php +++ b/engine/classes/ElggObject.php @@ -179,43 +179,6 @@ class ElggObject extends ElggEntity { return add_site_object($this->getGUID(), $site_guid); } - /** - * Set the container for this object. - * - * @param int $container_guid The ID of the container. - * - * @return bool - */ - function setContainer($container_guid) { - $container_guid = (int)$container_guid; - - return $this->set('container_guid', $container_guid); - } - - /** - * Returns the container GUID of this object. - * - * @return int - */ - function getContainer() { - return $this->get('container_guid'); - } - - /** - * Returns the contain entity for this object. - * - * @return mixed ElggGroup object or false. - */ - function getContainerEntity() { - $result = get_entity($this->getContainer()); - - if (($result) && ($result instanceof ElggGroup)) { - return $result; - } - - return false; - } - /* * EXPORTABLE INTERFACE */ |