/** * @param int|Domain|String $domain_id 可以是ID、Domain物件、URL * @param String $name * @return Group */ public function create_group($domain_id, $name) { $domain_id = $this->CI->domain->filter_domain_id($domain_id); $data = array('domain_id' => $domain_id, 'name' => $name); return parent::create($data); }
public function create_notification(User $association_actor, KALS_resource $resource, KALS_actor $actor = NULL) { $data = array('association_user_id' => $association_actor->get_id(), 'trigger_resource_type_id' => $resource->get_type_id(), 'trigger_resource_id' => $resource->get_id()); if (isset($actor)) { $data['trigger_actor_type_id'] = $actor->get_type_id(); $data['trigger_actor_id'] = $actor->get_id(); } if (!isset($data['association_user_id']) && $resource->get_type_id() == 3) { $data['association_user_id'] = $resource->get_field('user_id'); } $data['notification_type_id'] = $this->get_type_id(); $notification = $this->create($data); return $notification; }