36 parent::initializeAttributes();
38 $this->attributes[
'type'] = null;
39 $this->attributes[
'id'] = null;
40 $this->attributes[
'entity_guid'] = null;
41 $this->attributes[
'owner_guid'] = null;
43 $this->attributes[
'enabled'] =
'yes';
56 .
'All metadata will be public in 3.0.',
'2.3');
60 if (
$name ==
'value') {
61 $this->attributes[
'value_type'] = self::detectValueType(
$value);
74 $this->attributes[
'value'] =
$value;
75 $this->attributes[
'value_type'] = self::detectValueType(
$value, $value_type);
90 if (
$name ==
'value') {
91 $this->
setValue($value, $value_type);
106 if (array_key_exists(
$name, $this->attributes)) {
107 if (
$name ==
'value') {
108 switch ($this->attributes[
'value_type']) {
110 return (
int)$this->attributes[
'value'];
113 return $this->attributes[
'value'];
116 $msg =
"{$this->attributes['value_type']} is not a supported \ElggExtender value type.";
117 throw new \UnexpectedValueException($msg);
122 return $this->attributes[
$name];
189 $object->read_access = $this->access_id;
194 if (
_elgg_services()->hooks->hasHandler(
'to:object', $this->getSubtype())) {
195 _elgg_services()->deprecation->sendNotice(
"Triggering 'to:object' hook by extender name '{$this->getSubtype()}' has been deprecated. " 196 .
"Use the generic 'to:object','{$this->getType()}' hook instead.",
'2.3');
237 $meta->setAttribute(
'published', date(
"r", $this->time_created));
297 if (isset($CONFIG->extender_url_handler[
$type][
'all'])) {
298 $function = $CONFIG->extender_url_handler[
$type][
'all'];
300 if (isset($CONFIG->extender_url_handler[
'all'][
'all'])) {
301 $function = $CONFIG->extender_url_handler[
'all'][
'all'];
303 if (is_callable($function)) {
304 $url = call_user_func($function, $this);
312 $params = array(
'extender' => $this);
329 if ($value_type ===
'integer' || $value_type ===
'text') {
333 return is_int($value) ?
'integer' :
'text';
getType()
Return a type of extension.
$object
These two snippets demonstrates triggering an event and how to register for that event.
getTimeCreated()
Returns the UNIX epoch time that this entity was created.
initializeAttributes()
(non-PHPdoc)
getEntity()
Get the entity this describes.
get_uuid_from_object($object)
Get a UUID from a given object.
if($guid==elgg_get_logged_in_user_guid()) $name
__get($name)
Gets an attribute.
canEdit($user_guid=0)
Returns if a user can edit this entity extender.
static detectValueType($value, $value_type="")
Detect the value_type for a value to be stored as metadata or an annotation.
__set($name, $value)
Set an attribute.
getExportableValues()
Return an array of fields which can be exported.
export()
Export this object.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
elgg global
Pointer to the global context.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
getOwnerEntity()
Get the entity that owns this extender.
guid_to_uuid($guid)
Generate a UUID from a given GUID.
getOwnerGUID()
Get the GUID of the extender's owner entity.
getSystemLogID()
Return an identification for the object for storage in the system log.
$user_guid
Avatar remove action.
if(!$collection_name) $id
getSubtype()
Return a subtype.
setValue($value, $value_type= '')
Set the value of the extender.
getURL()
Get a url for this extender.
get_entity($guid)
Loads and returns an entity object from a guid.