aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggWidget.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes/ElggWidget.php')
-rw-r--r--engine/classes/ElggWidget.php37
1 files changed, 32 insertions, 5 deletions
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php
index 30cbc7dc2..c9a65967c 100644
--- a/engine/classes/ElggWidget.php
+++ b/engine/classes/ElggWidget.php
@@ -2,20 +2,42 @@
/**
* Override ElggObject in order to store widget data in ultra-private stores.
+ *
+ * @package Elgg.Core
+ * @subpackage Widgets
*/
class ElggWidget extends ElggObject {
+
+ /**
+ * Set subtype to widget.
+ *
+ * @deprecated 1.8 use ElggWidget::initializeAttributes()
+ *
+ * @return void
+ */
protected function initialise_attributes() {
- parent::initialise_attributes();
+ elgg_deprecated_notice('ElggWidget::initialise_attributes() is deprecated by ::initializeAttributes()', 1.8);
- $this->attributes['subtype'] = "widget";
+ return $this->initializeAttributes();
}
- public function __construct($guid = null) {
- parent::__construct($guid);
+ /**
+ * Set subtype to widget.
+ *
+ * @return void
+ */
+ protected function initializeAttributes() {
+ parent::initializeAttributes();
+
+ $this->attributes['subtype'] = "widget";
}
/**
* Override entity get and sets in order to save data to private data store.
+ *
+ * @param string $name Name
+ *
+ * @return mixed
*/
public function get($name) {
// See if its in our base attribute
@@ -35,11 +57,16 @@ class ElggWidget extends ElggObject {
/**
* Override entity get and sets in order to save data to private data store.
+ *
+ * @param string $name Name
+ * @param string $value Value
+ *
+ * @return bool
*/
public function set($name, $value) {
if (array_key_exists($name, $this->attributes)) {
// Check that we're not trying to change the guid!
- if ((array_key_exists('guid', $this->attributes)) && ($name=='guid')) {
+ if ((array_key_exists('guid', $this->attributes)) && ($name == 'guid')) {
return false;
}