ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
ilADTPresentationBridge Class Reference

ADT presentation bridge base class. More...

+ Inheritance diagram for ilADTPresentationBridge:
+ Collaboration diagram for ilADTPresentationBridge:

Public Member Functions

 __construct (ilADT $a_adt)
 Constructor. More...
 
 getADT ()
 Get ADT. More...
 
 getList ()
 Get list presentation. More...
 
 getHTML ()
 Get HTML presentation. More...
 
 getSortable ()
 Get sortable value presentation. More...
 
 setDecoratorCallBack ($a_callback)
 Set decorator callback. More...
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 Check if given ADT is valid. More...
 
 setADT (ilADT $a_adt)
 Set ADT. More...
 
 decorate ($a_value)
 Decorate value. More...
 

Protected Attributes

 $adt
 
 $decorator
 

Detailed Description

ADT presentation 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 11 of file class.ilADTPresentationBridge.php.

Constructor & Destructor Documentation

◆ __construct()

ilADTPresentationBridge::__construct ( ilADT  $a_adt)

Constructor.

Parameters
ilADT$a_adt
Returns
self

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

References isValidADT(), and setADT().

23  {
24  $this->setADT($a_adt);
25  }
+ Here is the call graph for this function:

Member Function Documentation

◆ decorate()

ilADTPresentationBridge::decorate (   $a_value)
protected

Decorate value.

Parameters
mixed$a_value
Returns
mixed

Definition at line 108 of file class.ilADTPresentationBridge.php.

Referenced by ilADTBooleanPresentationBridge\getHTML(), ilADTTextPresentationBridge\getHTML(), ilADTMultiTextPresentationBridge\getHTML(), ilADTMultiEnumPresentationBridge\getHTML(), ilADTDatePresentationBridge\getHTML(), ilADTIntegerPresentationBridge\getHTML(), ilADTEnumPresentationBridge\getHTML(), ilADTFloatPresentationBridge\getHTML(), ilADTDateTimePresentationBridge\getHTML(), ilADTLocationPresentationBridge\getHTML(), and ilADTGroupPresentationBridge\getHTML().

109  {
110  if(is_callable($this->decorator))
111  {
112  $a_value = call_user_func($this->decorator, $a_value);
113  }
114  return $a_value;
115  }
+ Here is the caller graph for this function:

◆ getADT()

◆ getHTML()

ilADTPresentationBridge::getHTML ( )
abstract

Get HTML presentation.

Returns
string

Referenced by getList().

+ Here is the caller graph for this function:

◆ getList()

ilADTPresentationBridge::getList ( )

Get list presentation.

Returns
string

Definition at line 73 of file class.ilADTPresentationBridge.php.

References getHTML(), and getSortable().

74  {
75  return $this->getHTML();
76  }
getHTML()
Get HTML presentation.
+ Here is the call graph for this function:

◆ getSortable()

ilADTPresentationBridge::getSortable ( )
abstract

Get sortable value presentation.

Returns
mixed

Referenced by getList().

+ Here is the caller graph for this function:

◆ isValidADT()

ilADTPresentationBridge::isValidADT ( ilADT  $a_adt)
abstractprotected

Check if given ADT is valid.

:TODO: This could be avoided with type-specifc constructors :TODO: bridge base class?

Parameters
ilADT$a_adt

Referenced by __construct(), and setADT().

+ Here is the caller graph for this function:

◆ setADT()

ilADTPresentationBridge::setADT ( ilADT  $a_adt)
protected

Set ADT.

Exceptions
Exception
Parameters
ilADT$a_adt

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

References isValidADT().

Referenced by __construct().

49  {
50  if(!$this->isValidADT($a_adt))
51  {
52  throw new Exception('ADTPresentationBridge Type mismatch.');
53  }
54 
55  $this->adt = $a_adt;
56  }
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDecoratorCallBack()

ilADTPresentationBridge::setDecoratorCallBack (   $a_callback)

Set decorator callback.

Parameters
string | array$a_callback

Definition at line 97 of file class.ilADTPresentationBridge.php.

98  {
99  $this->decorator = $a_callback;
100  }

Field Documentation

◆ $adt

ilADTPresentationBridge::$adt
protected

Definition at line 13 of file class.ilADTPresentationBridge.php.

Referenced by getADT().

◆ $decorator

ilADTPresentationBridge::$decorator
protected

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


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