Exemplo n.º 1
0
 private function findColumnSearch(ConfigDt $dtConfig, ColumnParams $column)
 {
     $dtColumn = $dtConfig->getColumn($column->getData());
     if ($dtColumn && $column->isSearchable()) {
         return $dtColumn->getServer();
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * @return \Doctrine\ORM\Query\Expr\OrderBy
  */
 public function generateOrderBy(ConfigDt $dtConfig, AjaxParams $ajaxParams)
 {
     foreach ($ajaxParams->getOrder() as $order) {
         $index = $order->getColumn();
         $column = isset($ajaxParams->getColumns()[$index]) ? $ajaxParams->getColumns()[$index] : null;
         $dtColumn = $dtConfig->getColumn($column->getData());
         if ($column && $column->isOrderable() && $dtColumn) {
             $name = $dtColumn->getServer()->getField()['name'];
             $alias = $dtColumn->getServer()->getField()['alias'];
             $this->add($alias . self::$point . $name, $order->getDir());
         }
     }
     return $this;
 }
Exemplo n.º 3
0
 /**
  * @return string
  */
 public static function getSelect(ConfigDt $dtConfig, AjaxParams $ajaxParams)
 {
     $selectNew = [];
     $partials = [];
     foreach ($ajaxParams->getColumns() as $column) {
         $dtColumn = $dtConfig->getColumn($column->getData());
         //$column->isSearchable() && $dtColumn
         if ($dtColumn) {
             $field = $dtColumn->getServer()->getField();
             $name = $field['name'];
             $alias = $field['alias'];
             if (isset($field['partial'])) {
                 $partials[$alias][] = $name;
             } else {
                 $selectNew[] = $alias . self::$point . $name . (isset($field['alias_name']) ? " AS {$field['alias_name']}" : '');
             }
         }
     }
     foreach ($partials as $key => $value) {
         $selectNew[] = "partial {$key}.{" . implode(',', $value) . "}";
     }
     return implode(',', $selectNew);
 }