ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceDataGatewayFactory Class Reference

Class ilTermsOfServiceDataGatewayFactory. More...

+ Collaboration diagram for ilTermsOfServiceDataGatewayFactory:

Public Member Functions

 setDatabaseAdapter (?ilDBInterface $db)
 
 getDatabaseAdapter ()
 
 getByName (string $name)
 

Protected Attributes

ilDBInterface $db = null
 

Detailed Description

Member Function Documentation

◆ getByName()

ilTermsOfServiceDataGatewayFactory::getByName ( string  $name)
Parameters
string$name
Returns
ilTermsOfServiceAcceptanceDatabaseGateway
Exceptions
InvalidArgumentException
ilTermsOfServiceMissingDatabaseAdapterException

Definition at line 45 of file class.ilTermsOfServiceDataGatewayFactory.php.

46  {
47  if (null === $this->db) {
48  throw new ilTermsOfServiceMissingDatabaseAdapterException('Incomplete factory configuration. Please inject a database adapter.');
49  }
50 
51  switch (strtolower($name)) {
52  case 'iltermsofserviceacceptancedatabasegateway':
53  return new ilTermsOfServiceAcceptanceDatabaseGateway($this->db);
54 
55  default:
56  throw new InvalidArgumentException('Data gateway not supported');
57  }
58  }
if($format !==null) $name
Definition: metadata.php:247
Interface ilTermsOfServiceAcceptanceDataGateway.

◆ getDatabaseAdapter()

ilTermsOfServiceDataGatewayFactory::getDatabaseAdapter ( )

◆ setDatabaseAdapter()

ilTermsOfServiceDataGatewayFactory::setDatabaseAdapter ( ?ilDBInterface  $db)

Definition at line 29 of file class.ilTermsOfServiceDataGatewayFactory.php.

References $db.

Referenced by ilTermsOfServiceHelper\__construct().

29  : void
30  {
31  $this->db = $db;
32  }
+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilDBInterface ilTermsOfServiceDataGatewayFactory::$db = null
protected

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