ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilAwarenessFeatureCollector.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
14 protected static $instances = array();
15
19 protected $collection;
20 protected $user_id;
21
27 protected function __construct($a_user_id)
28 {
29 $this->user_id = $a_user_id;
30 }
31
32
39 static function getInstance($a_user_id)
40 {
41 if (!isset(self::$instances[$a_user_id]))
42 {
43 self::$instances[$a_user_id] = new ilAwarenessFeatureCollector($a_user_id);
44 }
45
46 return self::$instances[$a_user_id];
47 }
48
54 public function getFeaturesForTargetUser($a_target_user)
55 {
56 // overall collection of users
57 include_once("./Services/Awareness/classes/class.ilAwarenessFeatureCollection.php");
59
60 include_once("./Services/Awareness/classes/class.ilAwarenessFeatureProviderFactory.php");
62 {
63 $prov->setUserId($this->user_id);
64 $coll = $prov->collectFeaturesForTargetUser($a_target_user);
65 foreach ($coll->getFeatures() as $feature)
66 {
67 $this->collection->addFeature($feature);
68 }
69 }
70
71 return $this->collection;
72 }
73
74
75}
76
77?>
Collects features from all feature providers.
static getInstance($a_user_id)
Get instance (for a user)
getFeaturesForTargetUser($a_target_user)
Collect users.
static getAllProviders()
Get all awareness providers.