ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilADTPresentationBridge.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
13  protected $adt; // [ilADT]
14  protected $decorator; // [String|Array]
15 
22  public function __construct(ilADT $a_adt)
23  {
24  $this->setADT($a_adt);
25  }
26 
27 
28  //
29  // properties
30  //
31 
40  abstract protected function isValidADT(ilADT $a_adt);
41 
48  protected function setADT(ilADT $a_adt)
49  {
50  if (!$this->isValidADT($a_adt)) {
51  throw new Exception('ADTPresentationBridge Type mismatch.');
52  }
53 
54  $this->adt = $a_adt;
55  }
56 
62  public function getADT()
63  {
64  return $this->adt;
65  }
66 
72  public function getList()
73  {
74  return $this->getHTML();
75  }
76 
82  abstract public function getHTML();
83 
89  abstract public function getSortable();
90 
96  public function setDecoratorCallBack($a_callback)
97  {
98  $this->decorator = $a_callback;
99  }
100 
107  protected function decorate($a_value)
108  {
109  if (is_callable($this->decorator)) {
110  $a_value = call_user_func($this->decorator, $a_value);
111  }
112  return $a_value;
113  }
114 }
__construct(ilADT $a_adt)
Constructor.
decorate($a_value)
Decorate value.
ADT base class.
Definition: class.ilADT.php:11
getSortable()
Get sortable value presentation.
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
getHTML()
Get HTML presentation.
setDecoratorCallBack($a_callback)
Set decorator callback.
ADT presentation bridge base class.