public function __construct(ElggData $object, $action, ElggEntity $actor = null)
{
if (get_class($this) == Event::class || get_class($this) == Elgg_Notifications_Event::class) {
_elgg_services()->deprecation->sendNotice(__CLASS__ . ' is deprecated. ' . 'Use ' . SubscriptionNotificationEvent::class . ' instead', '2.3');
}
if (!$object instanceof ElggData) {
throw new InvalidArgumentException(__METHOD__ . ' expects an object as an instance of ' . ElggData::class);
}
if (!$action) {
throw new InvalidArgumentException(__METHOD__ . ' expects a valid action name');
}
$this->object = $object;
$this->actor = $actor;
if (!isset($actor)) {
$this->actor = _elgg_services()->session->getLoggedInUser();
}
$this->action = $action;
}