ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilBuddySystemRelationStateFactory Class Reference

Class ilBuddySystemRelationStateFactory. More...

+ Collaboration diagram for ilBuddySystemRelationStateFactory:

Public Member Functions

 __construct (ilLanguage $lng)
 
 getValidStates ()
 Get all valid states. More...
 
 getInitialState ()
 
 getTableFilterStateMapper (ilBuddySystemRelationState $state)
 
 getStateButtonRendererByOwnerAndRelation (int $ownerId, ilBuddySystemRelation $relation)
 

Static Public Member Functions

static getInstance (?ilLanguage $lng=null)
 

Protected Attributes

 $lng
 

Static Protected Attributes

static $instance
 
static $validStates
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBuddySystemRelationStateFactory::__construct ( ilLanguage  $lng)

Member Function Documentation

◆ getInitialState()

ilBuddySystemRelationStateFactory::getInitialState ( )
Returns
ilBuddySystemRelationState
Exceptions
ilBuddySystemException

Definition at line 59 of file class.ilBuddySystemRelationStateFactory.php.

60 {
61 foreach ($this->getValidStates() as $state) {
62 if ($state->isInitial()) {
63 return $state;
64 }
65 }
66
67 throw new ilBuddySystemException("Could not find an initial state class");
68 }
Class ilBuddySystemException.
Interface ilBuddySystemRelationState.

References getValidStates().

+ Here is the call graph for this function:

◆ getInstance()

static ilBuddySystemRelationStateFactory::getInstance ( ?ilLanguage  $lng = null)
static

Definition at line 24 of file class.ilBuddySystemRelationStateFactory.php.

24 : self
25 {
26 global $DIC;
27
28 if (null === self::$instance) {
29 $lng = $lng ?? $DIC['lng'];
30
31 self::$instance = new self($lng);
32 }
33
34 return self::$instance;
35 }
$DIC
Definition: xapitoken.php:46

References $DIC, $instance, and $lng.

Referenced by ilBuddySystemGUI\__construct(), ilBuddySystemLinkButton\getHtml(), ilBuddyList\getRelationByUserId(), ilBuddySystemRelationsTableGUI\initFilter(), and ilBuddySystemRelationsTableGUI\populate().

+ Here is the caller graph for this function:

◆ getStateButtonRendererByOwnerAndRelation()

ilBuddySystemRelationStateFactory::getStateButtonRendererByOwnerAndRelation ( int  $ownerId,
ilBuddySystemRelation  $relation 
)
Parameters
int$ownerId
ilBuddySystemRelation$relation
Returns
ilBuddySystemRelationStateButtonRenderer

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

87 $stateClass = get_class($relation->getState());
88 $class = $stateClass . 'ButtonRenderer';
89
90 return new $class($ownerId, $relation);
91 }

◆ getTableFilterStateMapper()

ilBuddySystemRelationStateFactory::getTableFilterStateMapper ( ilBuddySystemRelationState  $state)

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

71 {
72 $stateClass = get_class($state);
73 $class = $stateClass . 'TableFilterMapper';
74
75 return new $class($this->lng, $state);
76 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getValidStates()

ilBuddySystemRelationStateFactory::getValidStates ( )

Get all valid states.

Returns
ilBuddySystemRelationState[]

Definition at line 41 of file class.ilBuddySystemRelationStateFactory.php.

41 : array
42 {
43 if (null !== self::$validStates) {
44 return self::$validStates;
45 }
46
47 return (self::$validStates = [
52 ]);
53 }

References $validStates.

Referenced by getInitialState().

+ Here is the caller graph for this function:

Field Documentation

◆ $instance

ilBuddySystemRelationStateFactory::$instance
staticprotected

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

Referenced by getInstance().

◆ $lng

ilBuddySystemRelationStateFactory::$lng
protected

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

Referenced by __construct(), and getInstance().

◆ $validStates

ilBuddySystemRelationStateFactory::$validStates
staticprotected

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

Referenced by getValidStates().


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