4require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemRelationRepository.php';
5require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemRelationCollection.php';
6require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemRelation.php';
7require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemException.php';
8require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
9require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemLinkedRelationState.php';
10require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemUnlinkedRelationState.php';
11require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemRequestedRelationState.php';
12require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemIgnoredRequestRelationState.php';
54 throw new ilBuddySystemException(sprintf(
"You cannot create an instance for the anonymous user (id: %s)", $usr_id));
57 if(isset(self::$instances[$usr_id]))
59 return self::$instances[$usr_id];
62 self::$instances[$usr_id] =
new self($usr_id);
63 return self::$instances[$usr_id];
69 public static function getInstanceByGlobalUser()
93 $this->relations_read =
false;
94 $this->relations =
null;
127 if(!$this->relations_read)
130 $this->relations_read =
true;
139 if(
null === $this->relations)
262 throw new InvalidArgumentException(sprintf(
"Please pass a numeric owner id, given: %s", var_export(
$owner_id, 1)));
284 if(!is_numeric($usr_id))
286 throw new InvalidArgumentException(sprintf(
"Please pass a numeric owner id, given: %s", var_export($usr_id, 1)));
294 require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemRelationStateFactory.php';
296 $relation->setIsOwnedByRequest(
true);
298 $relation->setBuddyUserId($usr_id);
299 $relation->setTimestamp(time());
317 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
356 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
393 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
400 $GLOBALS[
'ilAppEventHandler']->raise(
422 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateTransitionException.php';
440 require_once
'Services/Contact/BuddySystem/exceptions/class.ilBuddySystemRelationStateAlreadyGivenException.php';
unlink(ilBuddySystemRelation $relation)
getIgnoredRelations()
Gets all ignored relations.
link(ilBuddySystemRelation $relation)
setRelations(ilBuddySystemRelationCollection $relations)
ignore(ilBuddySystemRelation $relation)
getOwnerId()
Returns the user id of the buddy list owner.
getIgnoredRelationsForOwner()
Gets all ignored relations the buddy list owner has to interact with.
getRelationTargetUserId(ilBuddySystemRelation $relation)
setRepository($repository)
getLinkedRelations()
Gets all linked/approved relations.
getRelationByUserId($usr_id)
getRelationUserIds()
Returns an array of all user ids the buddy list owner has a relation with.
static getInstanceByUserId($usr_id)
getIgnoredRelationsByOwner()
Gets all ignored relations the buddy list owner initiated.
getRequestRelationsForOwner()
Gets all requested relations the buddy list owner has to interact with.
request(ilBuddySystemRelation $relation)
reset()
Remove the singleton instance from static array, used for unit tests.
getRequestedRelations()
Gets all requested relations.
destroy()
Removes all buddy system references of the user (persistently)
getRequestRelationsByOwner()
Gets all requested relations the buddy list owner initiated.
Class ilBuddySystemRelationCollection A collection which contains all entries of a buddy list.
Class ilBuddySystemRelationRepository.
Class ilBuddySystemRelation.
static _lookupLogin($a_user_id)
lookup login
static _isAnonymous($usr_id)
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.