ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilADTActiveRecordBridge Class Reference

ADT DB bridge base class. More...

+ Inheritance diagram for ilADTActiveRecordBridge:
+ Collaboration diagram for ilADTActiveRecordBridge:

Public Member Functions

 __construct (ilADT $a_adt)
 
 getADT ()
 Get ADT. More...
 
 setTable (string $a_table)
 
 getTable ()
 
 setElementId (string $a_value)
 Set element id (aka DB column[s] [prefix]) More...
 
 getElementId ()
 Get element id. More...
 
 setPrimary (array $a_value)
 Set primary fields (in MDB2 format) More...
 
 getPrimary ()
 Get primary fields. More...
 
 getActiveRecordFields ()
 Convert ADT to active record fields. More...
 
 getFieldValue (string $a_field_name)
 Get field value. More...
 
 setFieldValue (string $a_field_name, $a_field_value)
 Set field value. More...
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 
 setADT (ilADT $a_adt)
 Set ADT. More...
 

Protected Attributes

ilADT $adt
 
string $id
 
string $table
 
array $primary = []
 

Detailed Description

ADT DB bridge base class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 12 of file class.ilADTActiveRecordBridge.php.

Constructor & Destructor Documentation

◆ __construct()

ilADTActiveRecordBridge::__construct ( ilADT  $a_adt)

Definition at line 19 of file class.ilADTActiveRecordBridge.php.

References isValidADT(), and setADT().

20  {
21  $this->setADT($a_adt);
22  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getActiveRecordFields()

ilADTActiveRecordBridge::getActiveRecordFields ( )
abstract

Convert ADT to active record fields.

Returns
array

Referenced by getPrimary().

+ Here is the caller graph for this function:

◆ getADT()

ilADTActiveRecordBridge::getADT ( )

◆ getElementId()

ilADTActiveRecordBridge::getElementId ( )

Get element id.

Returns
string | null

Definition at line 71 of file class.ilADTActiveRecordBridge.php.

References $id.

Referenced by ilADTTextActiveRecordBridge\getActiveRecordFields().

71  : ?string
72  {
73  return $this->id;
74  }
+ Here is the caller graph for this function:

◆ getFieldValue()

ilADTActiveRecordBridge::getFieldValue ( string  $a_field_name)
abstract

Get field value.

Parameters
string$a_field_name
Returns

Referenced by getPrimary().

+ Here is the caller graph for this function:

◆ getPrimary()

ilADTActiveRecordBridge::getPrimary ( )

Get primary fields.

Returns
string[]

Definition at line 89 of file class.ilADTActiveRecordBridge.php.

References $primary, getActiveRecordFields(), getFieldValue(), and setFieldValue().

89  : array
90  {
91  return $this->primary;
92  }
+ Here is the call graph for this function:

◆ getTable()

ilADTActiveRecordBridge::getTable ( )

Definition at line 53 of file class.ilADTActiveRecordBridge.php.

References $table.

53  : ?string
54  {
55  return $this->table;
56  }

◆ isValidADT()

ilADTActiveRecordBridge::isValidADT ( ilADT  $a_adt)
abstractprotected

Referenced by __construct(), and setADT().

+ Here is the caller graph for this function:

◆ setADT()

ilADTActiveRecordBridge::setADT ( ilADT  $a_adt)
protected

Set ADT.

Parameters
ilADT$a_adt
Exceptions
InvalidArgumentException

Definition at line 31 of file class.ilADTActiveRecordBridge.php.

References isValidADT().

Referenced by __construct().

31  : void
32  {
33  if (!$this->isValidADT($a_adt)) {
34  throw new \InvalidArgumentException('ADTActiveRecordBridge Type mismatch.');
35  }
36  $this->adt = $a_adt;
37  }
isValidADT(ilADT $a_adt)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setElementId()

ilADTActiveRecordBridge::setElementId ( string  $a_value)

Set element id (aka DB column[s] [prefix])

Parameters
string$a_value

Definition at line 62 of file class.ilADTActiveRecordBridge.php.

62  : void
63  {
64  $this->id = $a_value;
65  }

◆ setFieldValue()

ilADTActiveRecordBridge::setFieldValue ( string  $a_field_name,
  $a_field_value 
)
abstract

Set field value.

Parameters
string$a_field_name
string | int$a_field_value

Referenced by getPrimary().

+ Here is the caller graph for this function:

◆ setPrimary()

ilADTActiveRecordBridge::setPrimary ( array  $a_value)

Set primary fields (in MDB2 format)

Parameters
string[]$a_value

Definition at line 80 of file class.ilADTActiveRecordBridge.php.

80  : void
81  {
82  $this->primary = $a_value;
83  }

◆ setTable()

ilADTActiveRecordBridge::setTable ( string  $a_table)

Definition at line 48 of file class.ilADTActiveRecordBridge.php.

48  : void
49  {
50  $this->table = $a_table;
51  }

Field Documentation

◆ $adt

ilADT ilADTActiveRecordBridge::$adt
protected

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

Referenced by getADT().

◆ $id

string ilADTActiveRecordBridge::$id
protected

Definition at line 15 of file class.ilADTActiveRecordBridge.php.

Referenced by getElementId().

◆ $primary

array ilADTActiveRecordBridge::$primary = []
protected

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

Referenced by getPrimary().

◆ $table

string ilADTActiveRecordBridge::$table
protected

Definition at line 16 of file class.ilADTActiveRecordBridge.php.

Referenced by getTable().


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