ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilUserActionCollector Class Reference

Collects actions from all action providers. More...

+ Collaboration diagram for ilUserActionCollector:

Public Member Functions

 getActionsForTargetUser ($a_target_user, $a_context_component_id, $a_context_id)
 Collect actions. More...
 

Static Public Member Functions

static getInstance ($a_user_id)
 Get instance (for a user) More...
 

Protected Member Functions

 __construct ($a_user_id)
 Constructor. More...
 

Protected Attributes

 $collection
 
 $user_id
 

Static Protected Attributes

static $instances = array()
 

Detailed Description

Collects actions from all action providers.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilUserActionCollector.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserActionCollector::__construct (   $a_user_id)
protected

Constructor.

Parameters
int$a_user_iduser id (usually the current user logged in)

Definition at line 27 of file class.ilUserActionCollector.php.

28  {
29  $this->user_id = $a_user_id;
30  }

Member Function Documentation

◆ getActionsForTargetUser()

ilUserActionCollector::getActionsForTargetUser (   $a_target_user,
  $a_context_component_id,
  $a_context_id 
)

Collect actions.

Returns
ilUserActionCollection action

Definition at line 54 of file class.ilUserActionCollector.php.

References $a_context_id, $collection, ilUserActionProviderFactory\getAllProviders(), ilUserActionCollection\getInstance(), and ilUserActionAdmin\lookupActive().

55  {
56  // overall collection of users
57  include_once("./Services/User/Actions/classes/class.ilUserActionCollection.php");
58  $this->collection = ilUserActionCollection::getInstance();
59 
60  include_once("./Services/User/Actions/classes/class.ilUserActionAdmin.php");
61 
62  include_once("./Services/User/Actions/classes/class.ilUserActionProviderFactory.php");
64  {
65  $prov->setUserId($this->user_id);
66  $coll = $prov->collectActionsForTargetUser($a_target_user);
67  foreach ($coll->getActions() as $action)
68  {
69  if (ilUserActionAdmin::lookupActive($a_context_component_id, $a_context_id, $prov->getComponentId(), $action->getType()))
70  {
71  $this->collection->addAction($action);
72  }
73  }
74  }
75 
76  return $this->collection;
77  }
static getInstance()
Get instance.
static getAllProviders()
Get all action providers.
$a_context_id
Definition: workflow.php:98
static lookupActive($a_context_comp, $a_context_id, $a_action_comp, $a_action_type)
Is activated?
+ Here is the call graph for this function:

◆ getInstance()

static ilUserActionCollector::getInstance (   $a_user_id)
static

Get instance (for a user)

Parameters
int$a_user_iduser id
Returns
ilUserActionCollector

Definition at line 39 of file class.ilUserActionCollector.php.

Referenced by ilAwarenessData\__construct().

40  {
41  if (!isset(self::$instances[$a_user_id]))
42  {
43  self::$instances[$a_user_id] = new ilUserActionCollector($a_user_id);
44  }
45 
46  return self::$instances[$a_user_id];
47  }
Collects actions from all action providers.
+ Here is the caller graph for this function:

Field Documentation

◆ $collection

ilUserActionCollector::$collection
protected

Definition at line 19 of file class.ilUserActionCollector.php.

Referenced by getActionsForTargetUser().

◆ $instances

ilUserActionCollector::$instances = array()
staticprotected

Definition at line 14 of file class.ilUserActionCollector.php.

◆ $user_id

ilUserActionCollector::$user_id
protected

Definition at line 20 of file class.ilUserActionCollector.php.


The documentation for this class was generated from the following file: