ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTermsOfServiceDataGatewayFactory Class Reference
+ Collaboration diagram for ilTermsOfServiceDataGatewayFactory:

Public Member Functions

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

Protected Attributes

 $db
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

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

Member Function Documentation

◆ getByName()

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

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

38  {
39  if(null == $this->db)
40  {
41  require_once 'Services/TermsOfService/exceptions/class.ilTermsOfServiceMissingDatabaseAdapterException.php';
42  throw new ilTermsOfServiceMissingDatabaseAdapterException('Incomplete factory configuration. Please inject a database adapter.');
43  }
44 
45  switch(strtolower($name))
46  {
47  case 'iltermsofserviceacceptancedatabasegateway':
48  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceAcceptanceDatabaseGateway.php';
49  return new ilTermsOfServiceAcceptanceDatabaseGateway($this->db);
50 
51  default:
52  throw new InvalidArgumentException('Data gateway not supported');
53  }
54  }

◆ getDatabaseAdapter()

ilTermsOfServiceDataGatewayFactory::getDatabaseAdapter ( )

◆ setDatabaseAdapter()

ilTermsOfServiceDataGatewayFactory::setDatabaseAdapter ( ilDBInterface  $db)
Parameters
ilDBInterface$db

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

References $db.

Field Documentation

◆ $db

ilTermsOfServiceDataGatewayFactory::$db
protected

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