ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

36 {
37 $this->setState($state, false);
38 }
setState(ilBuddySystemRelationState $state, bool $rememberPriorState=true)

References setState().

+ Here is the call graph for this function:

Member Function Documentation

◆ getBuddyUsrId()

ilBuddySystemRelation::getBuddyUsrId ( )

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

78 : int
79 {
80 return $this->buddyUsrId;
81 }

Referenced by ignore(), link(), request(), and unlink().

+ Here is the caller graph for this function:

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

61 {
62 return $this->priorState;
63 }
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 55 of file class.ilBuddySystemRelation.php.

56 {
57 return $this->state;
58 }
ilBuddySystemRelationState $state

References $state.

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

+ Here is the caller graph for this function:

◆ getTimestamp()

ilBuddySystemRelation::getTimestamp ( )

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

104 : int
105 {
106 return $this->timestamp;
107 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70

References $timestamp.

◆ getUsrId()

ilBuddySystemRelation::getUsrId ( )

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

91 : int
92 {
93 return $this->usrId;
94 }

Referenced by ignore(), ilBuddyList\ignore(), link(), ilBuddyList\link(), request(), and unlink().

+ Here is the caller graph for this function:

◆ ignore()

ilBuddySystemRelation::ignore ( )
Exceptions
ilBuddySystemRelationStateException

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

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 }

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

+ Here is the call graph for this function:

◆ isIgnored()

ilBuddySystemRelation::isIgnored ( )

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

189 : bool
190 {
191 return $this->getState() instanceof ilBuddySystemIgnoredRequestRelationState;
192 }

References getState().

+ Here is the call graph for this function:

◆ isLinked()

ilBuddySystemRelation::isLinked ( )

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

174 : bool
175 {
176 return $this->getState() instanceof ilBuddySystemLinkedRelationState;
177 }

References getState().

+ Here is the call graph for this function:

◆ isOwnedByActor()

ilBuddySystemRelation::isOwnedByActor ( )

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

65 : bool
66 {
67 return $this->isOwnedByActor;
68 }

◆ isRequested()

ilBuddySystemRelation::isRequested ( )

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

184 : bool
185 {
186 return $this->getState() instanceof ilBuddySystemRequestedRelationState;
187 }

References getState().

+ Here is the call graph for this function:

◆ isUnlinked()

ilBuddySystemRelation::isUnlinked ( )

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

179 : bool
180 {
181 return $this->getState() instanceof ilBuddySystemUnlinkedRelationState;
182 }

References getState().

+ Here is the call graph for this function:

◆ link()

ilBuddySystemRelation::link ( )
Exceptions
ilBuddySystemRelationStateException

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

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 }

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

+ Here is the call graph for this function:

◆ request()

ilBuddySystemRelation::request ( )
Exceptions
ilBuddySystemRelationStateException

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

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 }

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

+ Here is the call graph for this function:

◆ setPriorState()

ilBuddySystemRelation::setPriorState ( ilBuddySystemRelationState  $prior_state)
private

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

40 : void
41 {
42 $this->priorState = $prior_state;
43 }

Referenced by setState().

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

45 : self
46 {
47 if ($rememberPriorState) {
48 $this->setPriorState($this->getState());
49 }
50
51 $this->state = $state;
52 return $this;
53 }
setPriorState(ilBuddySystemRelationState $prior_state)

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

Referenced by __construct().

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

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 }

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

+ Here is the call graph for this function:

◆ wasIgnored()

ilBuddySystemRelation::wasIgnored ( )

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

209 : bool
210 {
212 }

References getPriorState().

+ Here is the call graph for this function:

◆ wasLinked()

ilBuddySystemRelation::wasLinked ( )

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

194 : bool
195 {
196 return $this->getPriorState() instanceof ilBuddySystemLinkedRelationState;
197 }

References getPriorState().

+ Here is the call graph for this function:

◆ wasRequested()

ilBuddySystemRelation::wasRequested ( )

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

204 : bool
205 {
206 return $this->getPriorState() instanceof ilBuddySystemRequestedRelationState;
207 }

References getPriorState().

+ Here is the call graph for this function:

◆ wasUnlinked()

ilBuddySystemRelation::wasUnlinked ( )

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

199 : bool
200 {
201 return $this->getPriorState() instanceof ilBuddySystemUnlinkedRelationState;
202 }

References getPriorState().

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

109 : self
110 {
111 $clone = clone $this;
112 $clone->timestamp = $timestamp;
113
114 return $clone;
115 }

References $timestamp.

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