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';
59 throw new ilBuddySystemException(sprintf(
"You cannot create an instance for the anonymous user (id: %s)", $usr_id));
62 if(isset(self::$instances[$usr_id]))
64 return self::$instances[$usr_id];
67 self::$instances[$usr_id] =
new self($usr_id);
68 return self::$instances[$usr_id];
78 return self::getInstanceByUserId($DIC->user()->getId());
91 $this->event_handler = $DIC[
'ilAppEventHandler'];
99 $this->relations_read =
false;
100 $this->relations = null;
133 if(!$this->relations_read)
136 $this->relations_read =
true;
145 if(null === $this->relations)
290 if(!is_numeric($usr_id))
300 require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemRelationStateFactory.php';
302 $relation->setIsOwnedByRequest(
true);
304 $relation->setBuddyUserId($usr_id);
305 $relation->setTimestamp(
time());
323 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
362 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
399 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
406 $this->event_handler->raise(
428 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateTransitionException.php';
446 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.