ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBuddySystemRelation Class Reference

Class ilBuddySystemRelation. More...

+ Collaboration diagram for ilBuddySystemRelation:

Public Member Functions

 __construct (ilBuddySystemRelationState $state)
 ilBuddySystemRelation constructor. More...
 
 setState (ilBuddySystemRelationState $state, bool $rememberPriorState=true)
 
 getState ()
 
 getPriorState ()
 
 isOwnedByActor ()
 
 setIsOwnedByActor (bool $isOwnedByActor)
 
 getBuddyUsrId ()
 
 setBuddyUsrId (int $buddyUsrId)
 
 getUsrId ()
 
 setUsrId (int $usrId)
 
 getTimestamp ()
 
 setTimestamp (int $timestamp)
 
 getCurrentPossibleTargetStates ()
 
 link ()
 
 unlink ()
 
 request ()
 
 ignore ()
 
 isLinked ()
 
 isUnlinked ()
 
 isRequested ()
 
 isIgnored ()
 
 wasLinked ()
 
 wasUnlinked ()
 
 wasRequested ()
 
 wasIgnored ()
 

Protected Attributes

 $isOwnedByActor = false
 
 $usrId
 
 $buddyUsrId
 
 $timestamp
 
 $state
 
 $priorState
 

Private Member Functions

 setPriorState (ilBuddySystemRelationState $prior_state)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBuddySystemRelation::__construct ( ilBuddySystemRelationState  $state)

ilBuddySystemRelation constructor.

Parameters
ilBuddySystemRelationState$state

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

References setState().

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

Member Function Documentation

◆ getBuddyUsrId()

◆ getCurrentPossibleTargetStates()

ilBuddySystemRelation::getCurrentPossibleTargetStates ( )
Returns
ilBuddySystemCollection

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

References ilBuddySystemRelationStateFilterRuleFactory\getInstance().

154  {
155  return ilBuddySystemRelationStateFilterRuleFactory::getInstance()->getFilterRuleByRelation($this)->getStates();
156  }
Interface ilBuddySystemCollection.
+ Here is the call graph for this function:

◆ getPriorState()

ilBuddySystemRelation::getPriorState ( )
Returns
ilBuddySystemRelationState|null

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

References $priorState.

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

+ Here is the caller graph for this function:

◆ getState()

◆ getTimestamp()

ilBuddySystemRelation::getTimestamp ( )

◆ getUsrId()

◆ ignore()

ilBuddySystemRelation::ignore ( )
Returns
self
Exceptions
ilBuddySystemRelationStateException

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

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

Referenced by ilBuddyList\ignore().

204  : self
205  {
206  if ($this->getUsrId() === $this->getBuddyUsrId()) {
207  throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
208  }
209 
210  $this->getState()->ignore($this);
211  return $this;
212  }
Class ilBuddySystemRelationStateException.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isIgnored()

ilBuddySystemRelation::isIgnored ( )
Returns
bool

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

References getState().

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

241  : bool
242  {
243  return $this->getState() instanceof ilBuddySystemIgnoredRequestRelationState;
244  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLinked()

ilBuddySystemRelation::isLinked ( )
Returns
bool

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

References getState().

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

217  : bool
218  {
219  return $this->getState() instanceof ilBuddySystemLinkedRelationState;
220  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isOwnedByActor()

ilBuddySystemRelation::isOwnedByActor ( )

◆ isRequested()

ilBuddySystemRelation::isRequested ( )
Returns
bool

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

References getState().

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

233  : bool
234  {
235  return $this->getState() instanceof ilBuddySystemRequestedRelationState;
236  }
Class ilBuddySystemRequestedRelationState.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isUnlinked()

ilBuddySystemRelation::isUnlinked ( )
Returns
bool

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

References getState().

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

225  : bool
226  {
227  return $this->getState() instanceof ilBuddySystemUnlinkedRelationState;
228  }
Class ilBuddySystemUnlinkedRelationState.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ link()

ilBuddySystemRelation::link ( )
Returns
self
Exceptions
ilBuddySystemRelationStateException

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

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

Referenced by ilBuddyList\link().

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

◆ request()

ilBuddySystemRelation::request ( )
Returns
self
Exceptions
ilBuddySystemRelationStateException

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

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

Referenced by ilBuddyList\request().

190  : self
191  {
192  if ($this->getUsrId() === $this->getBuddyUsrId()) {
193  throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
194  }
195 
196  $this->getState()->request($this);
197  return $this;
198  }
Class ilBuddySystemRelationStateException.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBuddyUsrId()

ilBuddySystemRelation::setBuddyUsrId ( int  $buddyUsrId)
Parameters
int$buddyUsrId
Returns
self

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

References $buddyUsrId.

108  : self
109  {
110  $this->buddyUsrId = $buddyUsrId;
111  return $this;
112  }

◆ setIsOwnedByActor()

ilBuddySystemRelation::setIsOwnedByActor ( bool  $isOwnedByActor)
Parameters
bool$isOwnedByActor
Returns
ilBuddySystemRelation

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

References $isOwnedByActor, and isOwnedByActor().

90  : self
91  {
93  return $this;
94  }
+ Here is the call graph for this function:

◆ setPriorState()

ilBuddySystemRelation::setPriorState ( ilBuddySystemRelationState  $prior_state)
private
Parameters
ilBuddySystemRelationState$prior_state
Returns
ilBuddySystemRelation

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

Referenced by setState().

72  : self
73  {
74  $this->priorState = $prior_state;
75  return $this;
76  }
+ Here is the caller graph for this function:

◆ setState()

ilBuddySystemRelation::setState ( ilBuddySystemRelationState  $state,
bool  $rememberPriorState = true 
)
Parameters
ilBuddySystemRelationState$state
$rememberPriorStateboolean
Returns
self

Definition at line 42 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().

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

◆ setTimestamp()

ilBuddySystemRelation::setTimestamp ( int  $timestamp)
Parameters
int$timestamp
Returns
self

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

References $timestamp.

144  : self
145  {
146  $this->timestamp = $timestamp;
147  return $this;
148  }

◆ setUsrId()

ilBuddySystemRelation::setUsrId ( int  $usrId)
Parameters
int$usrId
Returns
self

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

References $usrId.

126  : self
127  {
128  $this->usrId = $usrId;
129  return $this;
130  }

◆ unlink()

ilBuddySystemRelation::unlink ( )
Returns
self
Exceptions
ilBuddySystemRelationStateException

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

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

Referenced by ilBuddyList\unlink().

176  : self
177  {
178  if ($this->getUsrId() === $this->getBuddyUsrId()) {
179  throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
180  }
181 
182  $this->getState()->unlink($this);
183  return $this;
184  }
Class ilBuddySystemRelationStateException.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasIgnored()

ilBuddySystemRelation::wasIgnored ( )
Returns
bool

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

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

273  : bool
274  {
275  return $this->getPriorState() instanceof ilBuddySystemIgnoredRequestRelationState;
276  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasLinked()

ilBuddySystemRelation::wasLinked ( )
Returns
bool

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

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

249  : bool
250  {
251  return $this->getPriorState() instanceof ilBuddySystemLinkedRelationState;
252  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasRequested()

ilBuddySystemRelation::wasRequested ( )
Returns
bool

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

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

265  : bool
266  {
267  return $this->getPriorState() instanceof ilBuddySystemRequestedRelationState;
268  }
Class ilBuddySystemRequestedRelationState.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasUnlinked()

ilBuddySystemRelation::wasUnlinked ( )
Returns
bool

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

References getPriorState().

257  : bool
258  {
259  return $this->getPriorState() instanceof ilBuddySystemUnlinkedRelationState;
260  }
Class ilBuddySystemUnlinkedRelationState.
+ Here is the call graph for this function:

Field Documentation

◆ $buddyUsrId

ilBuddySystemRelation::$buddyUsrId
protected

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

Referenced by getBuddyUsrId(), and setBuddyUsrId().

◆ $isOwnedByActor

ilBuddySystemRelation::$isOwnedByActor = false
protected

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

Referenced by isOwnedByActor(), and setIsOwnedByActor().

◆ $priorState

ilBuddySystemRelation::$priorState
protected

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

Referenced by getPriorState().

◆ $state

ilBuddySystemRelation::$state
protected

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

Referenced by getState(), and setState().

◆ $timestamp

ilBuddySystemRelation::$timestamp
protected

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

Referenced by getTimestamp(), and setTimestamp().

◆ $usrId

ilBuddySystemRelation::$usrId
protected

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

Referenced by getUsrId(), and setUsrId().


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