ILIAS  release_7 Revision v7.30-3-g800a261c036
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.

33 {
34 $this->setState($state, false);
35 }
setState(ilBuddySystemRelationState $state, bool $rememberPriorState=true)

References setState().

+ 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().

+ 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()

ilBuddySystemRelation::getState ( )

◆ getTimestamp()

ilBuddySystemRelation::getTimestamp ( )

◆ getUsrId()

◆ ignore()

ilBuddySystemRelation::ignore ( )
Returns
self
Exceptions
ilBuddySystemRelationStateException

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

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 }

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 ( )
Returns
bool

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

241 : bool
242 {
243 return $this->getState() instanceof ilBuddySystemIgnoredRequestRelationState;
244 }

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 ( )
Returns
bool

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

217 : bool
218 {
219 return $this->getState() instanceof ilBuddySystemLinkedRelationState;
220 }

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 ( )
Returns
bool

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

233 : bool
234 {
235 return $this->getState() instanceof ilBuddySystemRequestedRelationState;
236 }

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 ( )
Returns
bool

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

225 : bool
226 {
227 return $this->getState() instanceof ilBuddySystemUnlinkedRelationState;
228 }

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

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

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 }

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:

◆ setBuddyUsrId()

◆ setIsOwnedByActor()

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

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

90 : self
91 {
93 return $this;
94 }

References $isOwnedByActor, and isOwnedByActor().

+ 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.

72 : self
73 {
74 $this->priorState = $prior_state;
75 return $this;
76 }

Referenced by setState().

+ 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.

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)

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:

◆ setTimestamp()

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

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

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

References $timestamp.

◆ setUsrId()

◆ unlink()

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

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 ( )
Returns
bool

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

273 : bool
274 {
276 }

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 ( )
Returns
bool

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

249 : bool
250 {
251 return $this->getPriorState() instanceof ilBuddySystemLinkedRelationState;
252 }

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 ( )
Returns
bool

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

265 : bool
266 {
267 return $this->getPriorState() instanceof ilBuddySystemRequestedRelationState;
268 }

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 ( )
Returns
bool

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

257 : bool
258 {
259 return $this->getPriorState() instanceof ilBuddySystemUnlinkedRelationState;
260 }

References getPriorState().

+ 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: