From 7ddd9521b3f3a397da3b0a6b56238d31414eb4be Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 28 Oct 2010 19:17:36 +0000 Subject: Standardized code in all of core, not including language files, tests, or core mods. git-svn-id: http://code.elgg.org/elgg/trunk@7124 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggAnnotation.php | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'engine/classes/ElggAnnotation.php') diff --git a/engine/classes/ElggAnnotation.php b/engine/classes/ElggAnnotation.php index ec2cedfe5..cdcfe363f 100644 --- a/engine/classes/ElggAnnotation.php +++ b/engine/classes/ElggAnnotation.php @@ -8,16 +8,16 @@ * * @internal Annotations are stored in the annotations table. * - * @package Elgg.Core + * @package Elgg.Core * @subpackage DataModel.Annotations - * @link http://docs.elgg.org/DataModel/Annotations + * @link http://docs.elgg.org/DataModel/Annotations */ class ElggAnnotation extends ElggExtender { /** * Construct a new annotation, optionally from a given id value or db object. * - * @param mixed $id + * @param mixed $id The annotation ID */ function __construct($id = null) { $this->attributes = array(); @@ -32,7 +32,7 @@ class ElggAnnotation extends ElggExtender { if ($annotation) { $objarray = (array) $annotation; - foreach($objarray as $key => $value) { + foreach ($objarray as $key => $value) { $this->attributes[$key] = $value; } @@ -44,7 +44,8 @@ class ElggAnnotation extends ElggExtender { /** * Class member get overloading * - * @param string $name + * @param string $name The name of the value to get + * * @return mixed */ function __get($name) { @@ -54,9 +55,10 @@ class ElggAnnotation extends ElggExtender { /** * Class member set overloading * - * @param string $name - * @param mixed $value - * @return void + * @param string $name The name of the value to set + * @param mixed $value The value to set + * + * @return mixed */ function __set($name, $value) { return $this->set($name, $value); @@ -69,7 +71,8 @@ class ElggAnnotation extends ElggExtender { */ function save() { if ($this->id > 0) { - return update_annotation($this->id, $this->name, $this->value, $this->value_type, $this->owner_guid, $this->access_id); + return update_annotation($this->id, $this->name, $this->value, $this->value_type, + $this->owner_guid, $this->access_id); } else { $this->id = create_annotation($this->entity_guid, $this->name, $this->value, $this->value_type, $this->owner_guid, $this->access_id); @@ -83,6 +86,8 @@ class ElggAnnotation extends ElggExtender { /** * Delete the annotation. + * + * @return bool */ function delete() { return delete_annotation($this->id); @@ -97,12 +102,16 @@ class ElggAnnotation extends ElggExtender { return get_annotation_url($this->id); } - // SYSTEM LOG INTERFACE //////////////////////////////////////////////////////////// + // SYSTEM LOG INTERFACE /** * For a given ID, return the object associated with it. * This is used by the river functionality primarily. * This is useful for checking access permissions etc on objects. + * + * @param int $id An annotation ID. + * + * @return ElggAnnotation */ public function getObjectFromID($id) { return get_annotation($id); -- cgit v1.2.3