ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilBuddySystemRelation Class Reference

Class ilBuddySystemRelation. More...

+ Collaboration diagram for ilBuddySystemRelation:

Public Member Functions

 __construct (ilBuddySystemRelationState $state, protected int $usrId, protected int $buddyUsrId, protected bool $isOwnedByActor, protected int $timestamp)
 
 setState (ilBuddySystemRelationState $state, bool $rememberPriorState=true)
 
 getState ()
 
 getPriorState ()
 
 isOwnedByActor ()
 
 withIsOwnedByActor (bool $isOwnedByActor)
 
 getBuddyUsrId ()
 
 withBuddyUsrId (int $buddyUsrId)
 
 getUsrId ()
 
 withUsrId (int $usrId)
 
 getTimestamp ()
 
 withTimestamp (int $timestamp)
 
 getCurrentPossibleTargetStates ()
 
 link ()
 
 unlink ()
 
 request ()
 
 ignore ()
 
 isLinked ()
 
 isUnlinked ()
 
 isRequested ()
 
 isIgnored ()
 
 wasLinked ()
 
 wasUnlinked ()
 
 wasRequested ()
 
 wasIgnored ()
 

Protected Attributes

ilBuddySystemRelationState $state
 
ilBuddySystemRelationState $priorState = null
 

Private Member Functions

 setPriorState (ilBuddySystemRelationState $prior_state)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBuddySystemRelation::__construct ( ilBuddySystemRelationState  $state,
protected int  $usrId,
protected int  $buddyUsrId,
protected bool  $isOwnedByActor,
protected int  $timestamp 
)

Definition at line 30 of file class.ilBuddySystemRelation.php.

References setState().

36  {
37  $this->setState($state, false);
38  }
setState(ilBuddySystemRelationState $state, bool $rememberPriorState=true)
+ Here is the call graph for this function:

Member Function Documentation

◆ getBuddyUsrId()

◆ getCurrentPossibleTargetStates()

ilBuddySystemRelation::getCurrentPossibleTargetStates ( )

Definition at line 117 of file class.ilBuddySystemRelation.php.

References ilBuddySystemRelationStateFilterRuleFactory\getInstance().

+ Here is the call graph for this function:

◆ getPriorState()

ilBuddySystemRelation::getPriorState ( )

Definition at line 60 of file class.ilBuddySystemRelation.php.

References $priorState.

Referenced by wasIgnored(), wasLinked(), wasRequested(), and wasUnlinked().

61  {
62  return $this->priorState;
63  }
ilBuddySystemRelationState $priorState
Interface ilBuddySystemRelationState.
+ Here is the caller graph for this function:

◆ getState()

ilBuddySystemRelation::getState ( )

◆ getTimestamp()

ilBuddySystemRelation::getTimestamp ( )

Definition at line 104 of file class.ilBuddySystemRelation.php.

References $timestamp.

Referenced by ilBuddySystemRelationRepository\addToApprovedBuddies(), ilBuddySystemRelationRepository\addToRequestedBuddies(), and ILIAS\Contact\Provider\ContactNotificationProvider\getNotifications().

104  : int
105  {
106  return $this->timestamp;
107  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
+ Here is the caller graph for this function:

◆ getUsrId()

◆ ignore()

ilBuddySystemRelation::ignore ( )
Exceptions
ilBuddySystemRelationStateException

Definition at line 164 of file class.ilBuddySystemRelation.php.

References getBuddyUsrId(), getState(), and getUsrId().

Referenced by ilBuddyList\ignore().

164  : self
165  {
166  if ($this->getUsrId() === $this->getBuddyUsrId()) {
167  throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
168  }
169 
170  $this->getState()->ignore($this);
171  return $this;
172  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isIgnored()

ilBuddySystemRelation::isIgnored ( )

Definition at line 189 of file class.ilBuddySystemRelation.php.

References getState().

Referenced by ilBuddyList\getIgnoredRelations(), ilBuddyList\ignore(), and ilBuddySystemRelationRepository\save().

189  : bool
190  {
191  return $this->getState() instanceof ilBuddySystemIgnoredRequestRelationState;
192  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLinked()

ilBuddySystemRelation::isLinked ( )

Definition at line 174 of file class.ilBuddySystemRelation.php.

References getState().

Referenced by ilBuddyList\getLinkedRelations(), ilBuddyList\ignore(), ilBuddyList\link(), and ilBuddySystemRelationRepository\save().

174  : bool
175  {
176  return $this->getState() instanceof ilBuddySystemLinkedRelationState;
177  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isOwnedByActor()

ilBuddySystemRelation::isOwnedByActor ( )

Definition at line 65 of file class.ilBuddySystemRelation.php.

Referenced by ilBuddySystemIgnoredRequestRelationStateTableFilterMapper\filterMatchesRelation(), and ilBuddySystemRequestedRelationStateTableFilterMapper\filterMatchesRelation().

65  : bool
66  {
67  return $this->isOwnedByActor;
68  }
+ Here is the caller graph for this function:

◆ isRequested()

ilBuddySystemRelation::isRequested ( )

Definition at line 184 of file class.ilBuddySystemRelation.php.

References getState().

Referenced by ilBuddyList\getRequestedRelations(), ilBuddyList\request(), and ilBuddySystemRelationRepository\save().

184  : bool
185  {
186  return $this->getState() instanceof ilBuddySystemRequestedRelationState;
187  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isUnlinked()

ilBuddySystemRelation::isUnlinked ( )

Definition at line 179 of file class.ilBuddySystemRelation.php.

References getState().

Referenced by ilBuddySystemGUI\requestCommand(), and ilBuddyList\unlink().

179  : bool
180  {
181  return $this->getState() instanceof ilBuddySystemUnlinkedRelationState;
182  }
Class ilBuddySystemUnlinkedRelationState.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ link()

ilBuddySystemRelation::link ( )
Exceptions
ilBuddySystemRelationStateException

Definition at line 125 of file class.ilBuddySystemRelation.php.

References getBuddyUsrId(), getState(), and getUsrId().

Referenced by ilBuddyList\link().

125  : self
126  {
127  if ($this->getUsrId() === $this->getBuddyUsrId()) {
128  throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
129  }
130 
131  $this->getState()->link($this);
132  return $this;
133  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ request()

ilBuddySystemRelation::request ( )
Exceptions
ilBuddySystemRelationStateException

Definition at line 151 of file class.ilBuddySystemRelation.php.

References getBuddyUsrId(), getState(), and getUsrId().

Referenced by ilBuddyList\request().

151  : self
152  {
153  if ($this->getUsrId() === $this->getBuddyUsrId()) {
154  throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
155  }
156 
157  $this->getState()->request($this);
158  return $this;
159  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPriorState()

ilBuddySystemRelation::setPriorState ( ilBuddySystemRelationState  $prior_state)
private

Definition at line 40 of file class.ilBuddySystemRelation.php.

Referenced by setState().

40  : void
41  {
42  $this->priorState = $prior_state;
43  }
+ Here is the caller graph for this function:

◆ setState()

ilBuddySystemRelation::setState ( ilBuddySystemRelationState  $state,
bool  $rememberPriorState = true 
)

Definition at line 45 of file class.ilBuddySystemRelation.php.

References $state, getState(), and setPriorState().

Referenced by __construct(), ilBuddySystemRequestedRelationState\ignore(), ilBuddySystemIgnoredRequestRelationState\link(), ilBuddySystemRequestedRelationState\link(), ilBuddySystemUnlinkedRelationState\request(), ilBuddySystemLinkedRelationState\unlink(), ilBuddySystemIgnoredRequestRelationState\unlink(), and ilBuddySystemRequestedRelationState\unlink().

45  : self
46  {
47  if ($rememberPriorState) {
48  $this->setPriorState($this->getState());
49  }
50 
51  $this->state = $state;
52  return $this;
53  }
ilBuddySystemRelationState $state
setPriorState(ilBuddySystemRelationState $prior_state)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlink()

ilBuddySystemRelation::unlink ( )
Exceptions
ilBuddySystemRelationStateException

Definition at line 138 of file class.ilBuddySystemRelation.php.

References getBuddyUsrId(), getState(), and getUsrId().

Referenced by ilBuddyList\unlink().

138  : self
139  {
140  if ($this->getUsrId() === $this->getBuddyUsrId()) {
141  throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
142  }
143 
144  $this->getState()->unlink($this);
145  return $this;
146  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasIgnored()

ilBuddySystemRelation::wasIgnored ( )

Definition at line 209 of file class.ilBuddySystemRelation.php.

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

209  : bool
210  {
211  return $this->getPriorState() instanceof ilBuddySystemIgnoredRequestRelationState;
212  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasLinked()

ilBuddySystemRelation::wasLinked ( )

Definition at line 194 of file class.ilBuddySystemRelation.php.

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

194  : bool
195  {
196  return $this->getPriorState() instanceof ilBuddySystemLinkedRelationState;
197  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasRequested()

ilBuddySystemRelation::wasRequested ( )

Definition at line 204 of file class.ilBuddySystemRelation.php.

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

204  : bool
205  {
206  return $this->getPriorState() instanceof ilBuddySystemRequestedRelationState;
207  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasUnlinked()

ilBuddySystemRelation::wasUnlinked ( )

Definition at line 199 of file class.ilBuddySystemRelation.php.

References getPriorState().

199  : bool
200  {
201  return $this->getPriorState() instanceof ilBuddySystemUnlinkedRelationState;
202  }
Class ilBuddySystemUnlinkedRelationState.
+ Here is the call graph for this function:

◆ withBuddyUsrId()

ilBuddySystemRelation::withBuddyUsrId ( int  $buddyUsrId)

Definition at line 83 of file class.ilBuddySystemRelation.php.

83  : self
84  {
85  $clone = clone $this;
86  $clone->buddyUsrId = $buddyUsrId;
87 
88  return $clone;
89  }

◆ withIsOwnedByActor()

ilBuddySystemRelation::withIsOwnedByActor ( bool  $isOwnedByActor)

Definition at line 70 of file class.ilBuddySystemRelation.php.

70  : self
71  {
72  $clone = clone $this;
73  $clone->isOwnedByActor = $isOwnedByActor;
74 
75  return $clone;
76  }

◆ withTimestamp()

ilBuddySystemRelation::withTimestamp ( int  $timestamp)

Definition at line 109 of file class.ilBuddySystemRelation.php.

References $timestamp.

109  : self
110  {
111  $clone = clone $this;
112  $clone->timestamp = $timestamp;
113 
114  return $clone;
115  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70

◆ withUsrId()

ilBuddySystemRelation::withUsrId ( int  $usrId)

Definition at line 96 of file class.ilBuddySystemRelation.php.

96  : self
97  {
98  $clone = clone $this;
99  $clone->usrId = $usrId;
100 
101  return $clone;
102  }

Field Documentation

◆ $priorState

ilBuddySystemRelationState ilBuddySystemRelation::$priorState = null
protected

Definition at line 28 of file class.ilBuddySystemRelation.php.

Referenced by getPriorState().

◆ $state

ilBuddySystemRelationState ilBuddySystemRelation::$state
protected

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

Referenced by getState(), and setState().


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