ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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

 $db
 

Detailed Description

Member Function Documentation

◆ getByContext()

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

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

23 {
24 switch ($context) {
26 $this->validateConfiguration(['db']);
28
31
32 default:
33 throw new InvalidArgumentException('Provider not supported');
34 }
35 }
Interface ilTermsOfServiceTableDataProvider.
$context
Definition: webdav.php:26

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

+ Here is the call graph for this function:

◆ getDatabaseAdapter()

ilTermsOfServiceTableDataProviderFactory::getDatabaseAdapter ( )
Returns
ilDBInterface|null

Definition at line 80 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
ilTermsOfServiceMissingDatabaseAdapterException
Exceptions
InvalidArgumentException

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

57 {
58 switch ($member) {
59 case 'db':
61 'Incomplete factory configuration. Please inject a database adapter.'
62 );
63
64 default:
65 throw new InvalidArgumentException("Exception for member {$member} not supported");
66 }
67 }

Referenced by validateConfiguration().

+ Here is the caller graph for this function:

◆ setDatabaseAdapter()

ilTermsOfServiceTableDataProviderFactory::setDatabaseAdapter ( ?ilDBInterface  $db)
Parameters
ilDBInterface | null$db

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

73 {
74 $this->db = $db;
75 }

References $db.

◆ validateConfiguration()

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

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

41 : void
42 {
43 foreach ($mandatoryMemberVariables as $member) {
44 if (null === $this->{$member}) {
45 $exception = $this->getExceptionByMember($member);
46 throw $exception;
47 }
48 }
49 }

References getExceptionByMember().

Referenced by getByContext().

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

Field Documentation

◆ $db

ilTermsOfServiceTableDataProviderFactory::$db
protected

◆ CONTEXT_ACCEPTANCE_HISTORY

◆ CONTEXT_DOCUMENTS

const ilTermsOfServiceTableDataProviderFactory::CONTEXT_DOCUMENTS = 'documents'

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