diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-03 04:27:53 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-03 04:27:53 +0000 |
commit | cea7ae1901061b65a62127f525d4361a44438332 (patch) | |
tree | 8b08c49c53aec818dbeb987b98a92c7c8a245a19 /engine/classes/ElggEntity.php | |
parent | 620a8adc6da005d842116a38700f79a82de7bdcc (diff) | |
download | elgg-cea7ae1901061b65a62127f525d4361a44438332.tar.gz elgg-cea7ae1901061b65a62127f525d4361a44438332.tar.bz2 |
Fixes #2134: Moved getContainerEntity() method to ElggEntity
git-svn-id: http://code.elgg.org/elgg/trunk@7219 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggEntity.php')
-rw-r--r-- | engine/classes/ElggEntity.php | 31 |
1 files changed, 31 insertions, 0 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 |