4 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemRelationRepository.php';
5 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemRelationCollection.php';
6 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemRelation.php';
7 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemException.php';
8 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
9 require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemLinkedRelationState.php';
10 require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemUnlinkedRelationState.php';
11 require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemRequestedRelationState.php';
12 require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemIgnoredRequestRelationState.php';
58 throw new ilBuddySystemException(sprintf(
"You cannot create an instance for the anonymous user (id: %s)", $usr_id));
61 if (isset(self::$instances[$usr_id])) {
62 return self::$instances[$usr_id];
65 self::$instances[$usr_id] =
new self($usr_id);
66 return self::$instances[$usr_id];
76 return self::getInstanceByUserId($DIC->user()->getId());
89 $this->event_handler = $DIC[
'ilAppEventHandler'];
97 $this->relations_read =
false;
98 $this->relations = null;
131 if (!$this->relations_read) {
133 $this->relations_read =
true;
142 if (null === $this->relations) {
285 if (!is_numeric($usr_id)) {
293 require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemRelationStateFactory.php';
295 $relation->setIsOwnedByRequest(
true);
297 $relation->setBuddyUserId($usr_id);
298 $relation->setTimestamp(
time());
314 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
346 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
377 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
384 $this->event_handler->raise(
404 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateTransitionException.php';
418 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
static _lookupLogin($a_user_id)
lookup login
getRequestRelationsByOwner()
Gets all requested relations the buddy list owner initiated.
static getInstanceByGlobalUser()
getIgnoredRelationsByOwner()
Gets all ignored relations the buddy list owner initiated.
request(ilBuddySystemRelation $relation)
getIgnoredRelationsForOwner()
Gets all ignored relations the buddy list owner has to interact with.
getRelationByUserId($usr_id)
ignore(ilBuddySystemRelation $relation)
getIgnoredRelations()
Gets all ignored relations.
getRelationUserIds()
Returns an array of all user ids the buddy list owner has a relation with.
Class ilBuddySystemRelationRepository.
unlink(ilBuddySystemRelation $relation)
reset()
Remove the singleton instance from static array, used for unit tests.
getRequestedRelations()
Gets all requested relations.
link(ilBuddySystemRelation $relation)
Class ilBuddySystemRelationCollection A collection which contains all entries of a buddy list...
getRequestRelationsForOwner()
Gets all requested relations the buddy list owner has to interact with.
static getInstanceByUserId($usr_id)
getRelationTargetUserId(ilBuddySystemRelation $relation)
getLinkedRelations()
Gets all linked/approved relations.
Create styles array
The data for the language used.
static _isAnonymous($usr_id)
setRepository($repository)
Class ilBuddySystemRelation.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
setRelations(ilBuddySystemRelationCollection $relations)
destroy()
Removes all buddy system references of the user (persistently)
getOwnerId()
Returns the user id of the buddy list owner.