Berkarar/plugins/rainlab/user/classes/UserEventBase.php

41 lines
931 B
PHP
Raw Permalink Normal View History

2022-08-28 19:50:26 +00:00
<?php namespace RainLab\User\Classes;
use RainLab\Notify\Classes\EventBase;
class UserEventBase extends EventBase
{
/**
* @var array Local conditions supported by this event.
*/
public $conditions = [
\RainLab\User\NotifyRules\UserAttributeCondition::class
];
/**
* Defines the usable parameters provided by this class.
*/
public function defineParams()
{
return [
'name' => [
'title' => 'Name',
'label' => 'Name of the user',
],
'email' => [
'title' => 'Email',
'label' => "User's email address",
],
];
}
public static function makeParamsFromEvent(array $args, $eventName = null)
{
$user = array_get($args, 0);
$params = $user->getNotificationVars();
$params['user'] = $user;
return $params;
}
}