<?php\r
-\r
/**\r
- * ElggExtender\r
+ * The base class for ElggEntity extenders.\r
+ *\r
+ * Extenders allow you to attach extended information to an\r
+ * ElggEntity. Core supports two: ElggAnnotation, ElggMetadata,\r
+ * and ElggRelationship\r
+ *\r
+ * Saving the extender data to database is handled by the child class.\r
+ *\r
+ * @tip Plugin authors would probably want to extend either ElggAnnotation\r
+ * or ElggMetadata instead of this class.\r
*\r
- * @author Curverider Ltd\r
- * @package Elgg\r
- * @subpackage Core\r
+ * @package Elgg.Core\r
+ * @subpackage DataModel.Extender\r
+ * @see ElggAnnotation\r
+ * @see ElggMetadata\r
+ * @link http://docs.elgg.org/DataModel/Extenders\r
*/\r
abstract class ElggExtender implements\r
Exportable,\r
ArrayAccess // Override for array access\r
{\r
/**\r
- * This contains the site's main properties (id, etc)\r
+ * Holds attributes to save to database\r
+ *\r
* @var array\r
*/\r
protected $attributes;\r
\r
/**\r
- * Get an attribute\r
+ * Returns an attribute\r
*\r
* @param string $name\r
* @return mixed\r
}\r
\r
/**\r
- * Return the owner of this annotation.\r
+ * Return the owner guid of this extender.\r
*\r
- * @return mixed\r
+ * @return int\r
*/\r
public function getOwner() {\r
return $this->owner_guid;\r
}\r
\r
/**\r
- * Return the owner entity\r
+ * Return the owner entity.\r
*\r
- * @return mixed\r
+ * @return ElggEntity|false\r
* @since 1.7.0\r
*/\r
public function getOwnerEntity() {\r
}\r
\r
/**\r
- * Returns the entity this is attached to\r
+ * Return the entity this describes.\r
*\r
* @return ElggEntity The enttiy\r
*/\r
abstract public function delete();\r
\r
/**\r
- * Determines whether or not the specified user can edit this\r
+ * Returns if a user can edit this extended data.\r
*\r
* @param int $user_guid The GUID of the user (defaults to currently logged in user)\r
- * @return true|false\r
+ * @return bool\r
*/\r
public function canEdit($user_guid = 0) {\r
return can_edit_extender($this->id,$this->type,$user_guid);\r
*/\r
public abstract function getURL();\r
\r
- // EXPORTABLE INTERFACE ////////////////////////////////////////////////////////////\r
+ /*\r
+ * EXPORTABLE INTERFACE\r
+ */\r
\r
/**\r
* Return an array of fields which can be exported.\r
+ *\r
+ * @return array\r
*/\r
public function getExportableValues() {\r
return array(\r
return $meta;\r
}\r
\r
- // SYSTEM LOG INTERFACE ////////////////////////////////////////////////////////////\r
+ /*\r
+ * SYSTEM LOG INTERFACE\r
+ */\r
\r
/**\r
* Return an identification for the object for storage in the system log.\r
\r
/**\r
* Return the class name of the object.\r
+ *\r
+ * @return string\r
*/\r
public function getClassName() {\r
return get_class($this);\r
\r
/**\r
* Return the GUID of the owner of this object.\r
+ *\r
+ * @return int\r
*/\r
public function getObjectOwnerGUID() {\r
return $this->owner_guid;\r
}\r
\r
/**\r
- * Return a type of the object - eg. object, group, user, relationship, metadata, annotation etc\r
+ * Return a type of extension.\r
+ *\r
+ * @return string\r
*/\r
public function getType() {\r
return $this->type;\r
/**\r
* Return a subtype. For metadata & annotations this is the 'name' and\r
* for relationship this is the relationship type.\r
+ *\r
+ * @return string\r
*/\r
public function getSubtype() {\r
return $this->name;\r
}\r
\r
\r
- // ITERATOR INTERFACE //////////////////////////////////////////////////////////////\r
+ /*\r
+ * ITERATOR INTERFACE\r
+ */\r
+\r
/*\r
* This lets an entity's attributes be displayed using foreach as a normal array.\r
* Example: http://www.sitepoint.com/print/php5-standard-library\r
*/\r
-\r
private $valid = FALSE;\r
\r
function rewind() {\r
return $this->valid;\r
}\r
\r
- // ARRAY ACCESS INTERFACE //////////////////////////////////////////////////////////\r
+ /*\r
+ * ARRAY ACCESS INTERFACE\r
+ */\r
+\r
/*\r
* This lets an entity's attributes be accessed like an associative array.\r
* Example: http://www.sitepoint.com/print/php5-standard-library\r
*/\r
-\r
function offsetSet($key, $value) {\r
if ( array_key_exists($key, $this->attributes) ) {\r
$this->attributes[$key] = $value;\r
<?php\r
/**\r
- * @class ElggPlugin Object representing a plugin's settings for a given site.\r
- * This class is currently a stub, allowing a plugin to saving settings in an object's metadata for each site.\r
- * @author Curverider Ltd\r
+ * Stores site-side plugin settings as private data.\r
+ *\r
+ * This class is currently a stub, allowing a plugin to\r
+ * save settings in an object's private settings for each site.\r
+ *\r
+ * @package Elgg.Core\r
+ * @subpackage Plugins.Settings\r
*/\r
class ElggPlugin extends ElggObject {\r
protected function initialise_attributes() {\r
}\r
\r
/**\r
- * Override entity get and sets in order to save data to private data store.\r
+ * Get a value from private settings.\r
+ *\r
+ * @param string $name\r
+ * @return mixed\r
*/\r
public function get($name) {\r
// See if its in our base attribute\r
}\r
\r
/**\r
- * Override entity get and sets in order to save data to private data store.\r
+ * Save a value to private settings.\r
+ *\r
+ * @param string $name\r
+ * @param mixed $value\r
*/\r
public function set($name, $value) {\r
if (array_key_exists($name, $this->attributes)) {\r