Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function addColumns(ColumnCollection $collection)
 {
     $collection->add(new Column(['id' => 'id', 'source' => 'user.id', 'caption' => $this->trans('user.id'), 'sorting' => ['default_order' => ColumnInterface::SORT_DIR_DESC], 'appearance' => ['width' => 90, 'visible' => false], 'filter' => ['type' => ColumnInterface::FILTER_BETWEEN]]));
     $collection->add(new Column(['id' => 'username', 'source' => 'user.username', 'caption' => $this->trans('user.username'), 'appearance' => ['width' => 70, 'align' => ColumnInterface::ALIGN_LEFT], 'filter' => ['type' => ColumnInterface::FILTER_INPUT]]));
     $collection->add(new Column(['id' => 'email', 'source' => 'user.email', 'caption' => $this->trans('user.email'), 'appearance' => ['width' => 70, 'align' => ColumnInterface::ALIGN_LEFT], 'filter' => ['type' => ColumnInterface::FILTER_INPUT]]));
     $collection->add(new Column(['id' => 'isActive', 'source' => 'user.isActive', 'caption' => $this->trans('user.is_active'), 'appearance' => ['width' => 70, 'align' => ColumnInterface::ALIGN_LEFT], 'filter' => ['type' => ColumnInterface::FILTER_INPUT]]));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function processResults($rows)
 {
     $rowData = [];
     foreach ($rows as $row) {
         $columns = [];
         foreach ($row as $param => $value) {
             $processFunction = $this->columns->get($param)->getProcessFunction();
             if (null != $processFunction) {
                 $value = call_user_func($processFunction, $value);
             }
             $columns[$param] = $this->transform($value);
         }
         $rowData[] = $columns;
     }
     return $rowData;
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function addColumns(ColumnCollection $collection)
 {
     $collection->add(new Column(['id' => 'id', 'source' => 'client_group.id', 'caption' => $this->trans('Id'), 'sorting' => ['default_order' => ColumnInterface::SORT_DIR_DESC], 'appearance' => ['width' => 90, 'visible' => false], 'filter' => ['type' => ColumnInterface::FILTER_BETWEEN]]));
     $collection->add(new Column(['id' => 'name', 'source' => 'client_group_translation.name', 'caption' => $this->trans('Name'), 'appearance' => ['width' => 70, 'align' => ColumnInterface::ALIGN_LEFT], 'filter' => ['type' => ColumnInterface::FILTER_INPUT]]));
 }