Beispiel #1
0
 public function __construct($name, $data, $columns, $pageLength = 1, $index = 0, $orientation = 'portrait', $paper = 'a4')
 {
     $this->setPDF(new MezPDFReport('2', $orientation, $paper));
     parent::__construct($name, $data, $columns, '', $pageLength, $index);
     $this->slot = array();
     $this->rawdata = NULL;
     $this->initializeOptions();
     $this->setWidth(100);
 }
Beispiel #2
0
 public function addColumn($column, $index = '')
 {
     $column->grid = $this;
     $class = strtolower(get_class($column));
     if (strpos($class, 'mdatagrid') !== false) {
         $this->columns[$column->field] = $column;
     } else {
         parent::addColumn($column);
     }
 }
Beispiel #3
0
 public function generateData()
 {
     if ($this->objArray == NULL) {
         $this->data = array();
     } else {
         $this->data = array();
         foreach ($this->objArray as $i => $row) {
             foreach ($this->columns as $k => $col) {
                 if (strpos(strtolower(get_class($col)), 'mobject') !== false) {
                     $method = 'get' . $col->attribute;
                     $v = method_exists($row, $method) ? $row->{$method}() : $row->{$col->attribute};
                     $this->data[$i][$k] = $v;
                 }
             }
         }
     }
     parent::generateData();
 }