You are here

public function HeartbeatActivity::set_actor in Heartbeat 7

Set the actor on the activity.

1 call to HeartbeatActivity::set_actor()
HeartbeatActivity::__construct in includes/heartbeatactivity.inc
constructor

File

includes/heartbeatactivity.inc, line 144
HeartbeatActivity object Defines one heartbeat activity object.

Class

HeartbeatActivity
Class defines an activity message object

Code

public function set_actor($data) {
  if (isset($data['actor'])) {
    $this->actor = $data['actor'];
  }
  elseif (!empty($data['name']) && !empty($data['created'])) {
    $this->actor = new stdClass();
    $this->actor->uid = $data['uid'];
    $this->actor->name = $data['name'];
    $this->actor->mail = $data['mail'];
    $this->actor->theme = $data['theme'];
    $this->actor->signature = $data['signature'];
    $this->actor->signature_format = $data['signature_format'];
    $this->actor->created = $data['created'];
    $this->actor->access = $data['users_access'];
    $this->actor->login = $data['login'];
    $this->actor->status = $data['status'];
    $this->actor->timezone = $data['timezone'];
    $this->actor->language = $data['language'];
    $this->actor->picture = $data['picture'];
    $this->actor->init = $data['init'];
    $this->actor->data = unserialize($data['data']);
  }
  else {
    $this->actor = user_load(isset($data['uid']) ? $data['uid'] : $GLOBALS['user']->uid);
  }
  $this->uid = $this->actor->uid;
}