aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggAnnotation.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-28 19:17:36 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-28 19:17:36 +0000
commit7ddd9521b3f3a397da3b0a6b56238d31414eb4be (patch)
tree6eb6a9a51db5fa0f5d3cc2ec6de29b9e258b12a1 /engine/classes/ElggAnnotation.php
parentbd3484417d170e62bc94e9db81d4ad37e8ddee6a (diff)
downloadelgg-7ddd9521b3f3a397da3b0a6b56238d31414eb4be.tar.gz
elgg-7ddd9521b3f3a397da3b0a6b56238d31414eb4be.tar.bz2
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
Diffstat (limited to 'engine/classes/ElggAnnotation.php')
-rw-r--r--engine/classes/ElggAnnotation.php29
1 files changed, 19 insertions, 10 deletions
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);