__construct() публичный Метод

public __construct ( )
 /**
  * @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;
     }
 }
Пример #2
0
 /**
  * @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);
     }
 }
Пример #3
0
 public function __construct($data, $cron = false)
 {
     parent::__construct($data, $cron);
     if (!($this->viewinfo = get_record_sql('SELECT u.*, v.title FROM {usr} u
                                      JOIN {view} v ON v.owner = u.id
                                      WHERE v.id = ?', array($this->view)))) {
         if (!empty($this->cron)) {
             // probably deleted already
             return;
         }
         throw new ViewNotFoundException(get_string('viewnotfound', 'error', $this->view));
     }
     $this->url = get_config('wwwroot') . 'view/view.php?id=' . $this->view;
     $this->users = array_diff_key(activity_get_viewaccess_users($this->view, $this->owner, $this->get_id()), $this->oldusers);
 }