Source for file AWidgetDecorator.php

Documentation is available at AWidgetDecorator.php

  1. <?php
  2. /**
  3.  *
  4.  */
  5.  
  6.  
  7. /**
  8.  * An extendable widget decorator that does nothing. Extend it to create decorators that do things!
  9.  */
  10. class AWidgetDecorator extends AWidget{
  11.     
  12.     protected $__childWidget;
  13.     
  14.     function __construct(AWidget $widget){
  15.         $this->__childWidget = $widget;
  16.         parent::__construct();
  17.         
  18.         
  19.     }
  20.     
  21.     /**
  22.      * Passes any method calls to the child widget
  23.      */
  24.     function __call($name,$args){
  25.         call_user_func_array(array(&$this->__childWidget,$name),$args);
  26.     }
  27.     
  28.     /**
  29.      * Sets the layout on the child widget
  30.      *
  31.      * @param unknown_type $layout 
  32.      * @return AWidget 
  33.      */
  34.     public function setLayout$layout {
  35.         $this->__childWidget->setLayout($layout);
  36.         return $this;
  37.     // end of member function setLayout
  38.  
  39.  
  40.     /**
  41.      * Calls render on the child widget
  42.      */
  43.     public function render){
  44.         return $this->__childWidget->render();
  45.     }
  46.  
  47.     /**
  48.      * Enter description here...
  49.      *
  50.      * @param string $name 
  51.      * @return AWidget 
  52.      */
  53.     public function addAttribute($name){
  54.         $this->__childWidget->addAttribute($name);
  55.         return $this;
  56.     }
  57.     
  58.     /**
  59.      * Enter description here...
  60.      *
  61.      * @param string $name 
  62.      * @return string 
  63.      */
  64.     public function getAttribute($name){
  65.         return $this->__childWidget->getAttribute($name);
  66.     }
  67.     
  68.     
  69.     /**
  70.      * Enter description here...
  71.      *
  72.      * @param string $name 
  73.      * @param string $value 
  74.      * @return AWidget 
  75.      */
  76.     public function setAttribute($name$value){
  77.         $this->__childWidget->setAttribute($name,$value);
  78.         return $this;
  79.     }
  80.     
  81.     
  82.     
  83.     public function getAttributes(){
  84.         return $this->__childWidget->getAttributes();
  85.     }
  86.     
  87.     
  88.     public function getLayout(){
  89.         return $this->__childWidget->getLayout();
  90.         
  91.     }
  92.     
  93.     
  94.     public function setObjectID($id){
  95.         parent::setObjectID($id);
  96.     }
  97.  
  98.     public function redraw(){
  99.         $this->__childWidget->redraw();
  100.     }
  101.     
  102. }

Documentation generated on Fri, 11 Jul 2008 13:28:44 -0400 by phpDocumentor 1.4.2