/** * @param array $data Parameters: * - group (integer) * - roles (list of roles) */ public function __construct($data, $cron = false) { require_once 'group.php'; parent::__construct($data, $cron); $members = group_get_member_ids($this->group, isset($this->roles) ? $this->roles : null, $this->deletedgroup); if (!empty($members)) { $this->users = activity_get_users($this->get_id(), $members); } }
/** * @param array $data Parameters: * - subject (string) * - message (string) * - group (integer) * - roles (list of roles) */ public function __construct($data, $cron = false) { require_once 'group.php'; parent::__construct($data, $cron); $this->groupinfo = get_record('group', 'id', $this->group); $members = group_get_member_ids($this->group, isset($this->roles) ? $this->roles : null); $this->users = activity_get_users($this->get_id(), $members); if ($this->submittedview) { $this->viewinfo = get_record('view', 'id', $this->submittedview); $this->viewinfo->ownername = display_name($this->viewinfo->owner); $this->url = get_config('wwwroot') . 'view/view.php?id=' . $this->submittedview; } }