ILIAS  release_8 Revision v8.24
ilTermsOfServiceTableDataProviderFactory Class Reference

Class ilTermsOfServiceTableDataProviderFactory. More...

+ Collaboration diagram for ilTermsOfServiceTableDataProviderFactory:

Public Member Functions

 getByContext (string $context)
 
 setDatabaseAdapter (?ilDBInterface $db)
 
 getDatabaseAdapter ()
 

Data Fields

const CONTEXT_ACCEPTANCE_HISTORY = 'acceptance_history'
 
const CONTEXT_DOCUMENTS = 'documents'
 

Protected Member Functions

 validateConfiguration (array $mandatoryMemberVariables)
 
 getExceptionByMember (string $member)
 

Protected Attributes

ilDBInterface $db = null
 

Detailed Description

Member Function Documentation

◆ getByContext()

ilTermsOfServiceTableDataProviderFactory::getByContext ( string  $context)
Parameters
string$context
Returns
ilTermsOfServiceTableDataProvider
Exceptions
ilTermsOfServiceMissingDatabaseAdapterException
InvalidArgumentException

Definition at line 38 of file class.ilTermsOfServiceTableDataProviderFactory.php.

39 {
40 switch ($context) {
42 $this->validateConfiguration(['db']);
44
47
48 default:
49 throw new InvalidArgumentException('Provider not supported');
50 }
51 }
Interface ilTermsOfServiceTableDataProvider.
$context
Definition: webdav.php:29

References $context, CONTEXT_ACCEPTANCE_HISTORY, CONTEXT_DOCUMENTS, getDatabaseAdapter(), and validateConfiguration().

+ Here is the call graph for this function:

◆ getDatabaseAdapter()

ilTermsOfServiceTableDataProviderFactory::getDatabaseAdapter ( )

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

References $db.

Referenced by getByContext().

+ Here is the caller graph for this function:

◆ getExceptionByMember()

ilTermsOfServiceTableDataProviderFactory::getExceptionByMember ( string  $member)
protected
Parameters
string$member
Returns
ilTermsOfServiceException
Exceptions
InvalidArgumentException

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

73 {
74 switch ($member) {
75 case 'db':
77 'Incomplete factory configuration. Please inject a database adapter.'
78 );
79
80 default:
81 throw new InvalidArgumentException("Exception for member $member not supported");
82 }
83 }
Class ilTermsOfServiceMissingDatabaseAdapterException.

Referenced by validateConfiguration().

+ Here is the caller graph for this function:

◆ setDatabaseAdapter()

ilTermsOfServiceTableDataProviderFactory::setDatabaseAdapter ( ?ilDBInterface  $db)

Definition at line 85 of file class.ilTermsOfServiceTableDataProviderFactory.php.

85 : void
86 {
87 $this->db = $db;
88 }

References $db.

◆ validateConfiguration()

ilTermsOfServiceTableDataProviderFactory::validateConfiguration ( array  $mandatoryMemberVariables)
protected
Parameters
array$mandatoryMemberVariables
Exceptions
ilTermsOfServiceMissingDatabaseAdapterException

Definition at line 57 of file class.ilTermsOfServiceTableDataProviderFactory.php.

57 : void
58 {
59 foreach ($mandatoryMemberVariables as $member) {
60 if (null === $this->{$member}) {
61 $exception = $this->getExceptionByMember($member);
62 throw $exception;
63 }
64 }
65 }

References getExceptionByMember().

Referenced by getByContext().

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

Field Documentation

◆ $db

ilDBInterface ilTermsOfServiceTableDataProviderFactory::$db = null
protected

◆ CONTEXT_ACCEPTANCE_HISTORY

◆ CONTEXT_DOCUMENTS

const ilTermsOfServiceTableDataProviderFactory::CONTEXT_DOCUMENTS = 'documents'

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