6 use InvalidArgumentException;
18 use EventSerialization;
39 if (get_class($this) == Event::class || get_class($this) == Elgg_Notifications_Event::class) {
40 _elgg_services()->deprecation->sendNotice(__CLASS__ .
' is deprecated. '
41 .
'Use ' . SubscriptionNotificationEvent::class .
' instead',
'2.3');
44 throw new InvalidArgumentException(__METHOD__ .
' expects an object as an instance of ' . ElggData::class);
47 throw new InvalidArgumentException(__METHOD__ .
' expects a valid action name');
83 return $this->actor ? $this->actor->guid : 0;
114 return implode(
':', [
116 $this->object->getType(),
117 $this->object->getSubtype(),
128 $obj =
new stdClass();
129 $vars = get_object_vars($this);
131 if (is_object(
$value) && is_callable([
$value,
'toObject'])) {
132 $obj->$key =
$value->toObject();
elgg button elgg button action
getObject()
Get the object of the event.
getActor()
Get the actor of the event.
getDescription()
Get a description of the event.
getAction()
Get the name of the action.
getActorGUID()
Get the GUID of the actor.
__construct(ElggData $object, $action, ElggEntity $actor=null)
Create a notification event.
toObject()
Export the notification event into a serializable object This method is mainly used for logging purpo...
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.