ILIAS  release_8 Revision v8.24
ilBuddySystemRelation Class Reference

Class ilBuddySystemRelation. More...

+ Collaboration diagram for ilBuddySystemRelation:

Public Member Functions

 __construct (ilBuddySystemRelationState $state, int $usrId, int $buddyUsrId, bool $isOwnedByActor, 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
 
int $usrId
 
int $buddyUsrId
 
bool $isOwnedByActor
 
int $timestamp
 
ilBuddySystemRelationState $priorState = null
 

Private Member Functions

 setPriorState (ilBuddySystemRelationState $prior_state)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

40 {
41 $this->usrId = $usrId;
42 $this->buddyUsrId = $buddyUsrId;
44 $this->timestamp = $timestamp;
45 $this->setState($state, false);
46 }
setState(ilBuddySystemRelationState $state, bool $rememberPriorState=true)

References $buddyUsrId, $isOwnedByActor, $timestamp, $usrId, isOwnedByActor(), and setState().

+ Here is the call graph for this function:

Member Function Documentation

◆ getBuddyUsrId()

◆ getCurrentPossibleTargetStates()

ilBuddySystemRelation::getCurrentPossibleTargetStates ( )

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

References ilBuddySystemRelationStateFilterRuleFactory\getInstance().

+ Here is the call graph for this function:

◆ getPriorState()

ilBuddySystemRelation::getPriorState ( )

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

69 {
70 return $this->priorState;
71 }
ilBuddySystemRelationState $priorState
Interface ilBuddySystemRelationState.

References $priorState.

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

+ Here is the caller graph for this function:

◆ getState()

ilBuddySystemRelation::getState ( )

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

64 {
65 return $this->state;
66 }
ilBuddySystemRelationState $state

References $state.

Referenced by ignore(), isIgnored(), isLinked(), isRequested(), isUnlinked(), link(), ilBuddySystemRelationsTableGUI\populate(), request(), setState(), and unlink().

+ Here is the caller graph for this function:

◆ getTimestamp()

ilBuddySystemRelation::getTimestamp ( )

◆ getUsrId()

◆ ignore()

ilBuddySystemRelation::ignore ( )
Returns
self
Exceptions
ilBuddySystemRelationStateException

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

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()->ignore($this);
183 return $this;
184 }

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

Referenced by ilBuddyList\ignore().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isIgnored()

ilBuddySystemRelation::isIgnored ( )

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

201 : bool
202 {
203 return $this->getState() instanceof ilBuddySystemIgnoredRequestRelationState;
204 }

References getState().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLinked()

ilBuddySystemRelation::isLinked ( )

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

186 : bool
187 {
188 return $this->getState() instanceof ilBuddySystemLinkedRelationState;
189 }

References getState().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isOwnedByActor()

ilBuddySystemRelation::isOwnedByActor ( )

◆ isRequested()

ilBuddySystemRelation::isRequested ( )

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

196 : bool
197 {
198 return $this->getState() instanceof ilBuddySystemRequestedRelationState;
199 }

References getState().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isUnlinked()

ilBuddySystemRelation::isUnlinked ( )

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

191 : bool
192 {
193 return $this->getState() instanceof ilBuddySystemUnlinkedRelationState;
194 }

References getState().

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

+ 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 134 of file class.ilBuddySystemRelation.php.

134 : self
135 {
136 if ($this->getUsrId() === $this->getBuddyUsrId()) {
137 throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
138 }
139
140 $this->getState()->link($this);
141 return $this;
142 }

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

Referenced by ilBuddyList\link().

+ 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 162 of file class.ilBuddySystemRelation.php.

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()->request($this);
169 return $this;
170 }

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

Referenced by ilBuddyList\request().

+ 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 48 of file class.ilBuddySystemRelation.php.

48 : void
49 {
50 $this->priorState = $prior_state;
51 }

Referenced by setState().

+ Here is the caller graph for this function:

◆ setState()

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

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

53 : self
54 {
55 if ($rememberPriorState) {
56 $this->setPriorState($this->getState());
57 }
58
59 $this->state = $state;
60 return $this;
61 }
setPriorState(ilBuddySystemRelationState $prior_state)

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlink()

ilBuddySystemRelation::unlink ( )
Returns
self
Exceptions
ilBuddySystemRelationStateException

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

148 : self
149 {
150 if ($this->getUsrId() === $this->getBuddyUsrId()) {
151 throw new ilBuddySystemRelationStateException("Can't change a state when the requester equals the requestee.");
152 }
153
154 $this->getState()->unlink($this);
155 return $this;
156 }

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

Referenced by ilBuddyList\unlink().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasIgnored()

ilBuddySystemRelation::wasIgnored ( )

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

221 : bool
222 {
224 }

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasLinked()

ilBuddySystemRelation::wasLinked ( )

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

206 : bool
207 {
208 return $this->getPriorState() instanceof ilBuddySystemLinkedRelationState;
209 }

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasRequested()

ilBuddySystemRelation::wasRequested ( )

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

216 : bool
217 {
218 return $this->getPriorState() instanceof ilBuddySystemRequestedRelationState;
219 }

References getPriorState().

Referenced by ilBuddySystemRelationRepository\save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wasUnlinked()

ilBuddySystemRelation::wasUnlinked ( )

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

211 : bool
212 {
213 return $this->getPriorState() instanceof ilBuddySystemUnlinkedRelationState;
214 }

References getPriorState().

+ Here is the call graph for this function:

◆ withBuddyUsrId()

ilBuddySystemRelation::withBuddyUsrId ( int  $buddyUsrId)

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

91 : self
92 {
93 $clone = clone $this;
94 $clone->buddyUsrId = $buddyUsrId;
95
96 return $clone;
97 }

References $buddyUsrId.

◆ withIsOwnedByActor()

ilBuddySystemRelation::withIsOwnedByActor ( bool  $isOwnedByActor)

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

78 : self
79 {
80 $clone = clone $this;
81 $clone->isOwnedByActor = $isOwnedByActor;
82
83 return $clone;
84 }

References $isOwnedByActor.

◆ withTimestamp()

ilBuddySystemRelation::withTimestamp ( int  $timestamp)

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

117 : self
118 {
119 $clone = clone $this;
120 $clone->timestamp = $timestamp;
121
122 return $clone;
123 }

References $timestamp.

◆ withUsrId()

ilBuddySystemRelation::withUsrId ( int  $usrId)

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

104 : self
105 {
106 $clone = clone $this;
107 $clone->usrId = $usrId;
108
109 return $clone;
110 }

References $usrId.

Field Documentation

◆ $buddyUsrId

int ilBuddySystemRelation::$buddyUsrId
protected

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

Referenced by __construct(), getBuddyUsrId(), and withBuddyUsrId().

◆ $isOwnedByActor

bool ilBuddySystemRelation::$isOwnedByActor
protected

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

Referenced by __construct(), isOwnedByActor(), and withIsOwnedByActor().

◆ $priorState

ilBuddySystemRelationState ilBuddySystemRelation::$priorState = null
protected

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

◆ $timestamp

int ilBuddySystemRelation::$timestamp
protected

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

Referenced by __construct(), getTimestamp(), and withTimestamp().

◆ $usrId

int ilBuddySystemRelation::$usrId
protected

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

Referenced by __construct(), getUsrId(), and withUsrId().


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