diff options
Diffstat (limited to 'engine/classes/ElggRiverItem.php')
| -rw-r--r-- | engine/classes/ElggRiverItem.php | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/engine/classes/ElggRiverItem.php b/engine/classes/ElggRiverItem.php index 6ff9b01d1..d3d09cd91 100644 --- a/engine/classes/ElggRiverItem.php +++ b/engine/classes/ElggRiverItem.php @@ -4,9 +4,19 @@ * * @package Elgg.Core * @subpackage Core + * + * @property int $id The unique identifier (read-only) + * @property int $subject_guid The GUID of the actor + * @property int $object_guid The GUID of the object + * @property int $annotation_id The ID of the annotation involved in the action + * @property string $type The type of one of the entities involved in the action + * @property string $subtype The subtype of one of the entities involved in the action + * @property string $action_type The name of the action + * @property string $view The view for displaying this river item + * @property int $access_id The visibility of the river item + * @property int $posted UNIX timestamp when the action occurred */ -class ElggRiverItem -{ +class ElggRiverItem { public $id; public $subject_guid; public $object_guid; @@ -28,8 +38,14 @@ class ElggRiverItem // throw exception } + // the casting is to support typed serialization like json + $int_types = array('id', 'subject_guid', 'object_guid', 'annotation_id', 'access_id', 'posted'); foreach ($object as $key => $value) { - $this->$key = $value; + if (in_array($key, $int_types)) { + $this->$key = (int)$value; + } else { + $this->$key = $value; + } } } @@ -57,7 +73,7 @@ class ElggRiverItem * @return ElggAnnotation */ public function getAnnotation() { - return get_annotation($this->annotation_id); + return elgg_get_annotation_from_id($this->annotation_id); } /** |
