@param array $tableData
@param array $visibleColumns

@return string
962540
public function generateTableBody(array $tableData = array(), $visibleColumns = array())
    {
        $_table_body = "";

        if (!empty($tableData)) {
            foreach ($tableData as $_row) {
                $_tr_data = "";
                foreach ($visibleColumns as $key => $_column) {
                    $_tr_data .= $this->generateTD($_row[$_column->getName()]);
                }
                $_table_body .= $this->generateTR($_tr_data);
            }
        } else {
            $_table_body = $this->generateElement('tr', array(), $this->generateElement('td', array('style' => 'text-align: center', 'colspan' => "".sizeof($visibleColumns)), "<em>No records found</em>", true) , true);
        }

        return $this->generateElement('tbody', array(), $_table_body, true);
    }
912377
public static function getClassData(&$classData = null) {
		$class = static::getClass();
		if( !isset(static::$knownClassData[$class]) ) {
			static::$knownClassData[$class] = (object)array(
				'sqlAdapter' => null,
			);
		}
		$classData = static::$knownClassData[$class];
		return $classData;
	}
348932
private static function pretty(array $data) {

        $color = new Color();
        $output = $color->getColoredString(self::VERBOSE_TITLE, 'blue', 'light-gray').PHP_EOL;

        foreach($data as $key => $value) {
            if(is_array($value) === false) {
                $output .= $color->getColoredString(sprintf(self::VERBOSE_ROW, $key, $value), 'dark_gray').PHP_EOL;
            }
            else {
                $output .= $color->getColoredString(sprintf(self::VERBOSE_ROW, $key, ''), 'dark_gray').PHP_EOL;
                foreach($value as $line => $string) {
                    $output .= $color->getColoredString(sprintf("\t".self::VERBOSE_ROW, '', $string), 'dark_gray').PHP_EOL;
                }
            }
        }
        $output .= $color->getColoredString('-----------------', 'blue', 'light-gray').PHP_EOL;

        return $output;
    }
820572
public JKTableColumn getTableColumn(final int col, final boolean visibleIndex) {
		int actualIndex;
		if (visibleIndex) {
			actualIndex = this.visibilityManager.getActualIndexFromVisibleIndex(col);
		} else {
			actualIndex = col;
		}
		return this.tableColumns.get(actualIndex);
	}
109536
public function GetTableColumnsMeta($tableName, $columnNames) {
        $tableColumnsMetadata = array();
        foreach ($columnNames as $columnName) {
            $this->setDbConfigList(array());
            $dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::COLUMNMETAS, new \Puzzlout\Framework\Dal\DbQueryFilters());
            $dbConfig->setQuery("SHOW COLUMNS FROM `$tableName` WHERE `Field` = '$columnName';");
            $this->addDbConfigItem($dbConfig);
            $tableColumnsMetadata[$columnName] = $this->BindParametersAndExecute();
        }
        return $tableColumnsMetadata;
    }
804442
public function generateGridViewFieldIndex($attribute, $fk, $tableSchema = null)
    {
        if (is_null($tableSchema)) {
            $tableSchema = $this->getTableSchema();
        }
        if (in_array($attribute, $this->hiddenColumns)) {
            return "['attribute' => '$attribute', 'visible' => false],\n";
        }
//        $humanize = Inflector::humanize($attribute, true);
        if ($tableSchema === false || !isset($tableSchema->columns[$attribute])) {
            if (preg_match('/^(password|pass|passwd|passcode)$/i', $attribute)) {
                return "";
            } else {
                return "'$attribute',\n";
            }
        }
        $column = $tableSchema->columns[$attribute];
        $format = $this->generateColumnFormat($column);
//        if($column->autoIncrement){
//            return "";
//        } else
if (array_key_exists($attribute, $fk) && $attribute) {
            $rel = $fk[$attribute];
            $labelCol = $this->getNameAttributeFK($rel[3]);
            $humanize = Inflector::humanize($rel[3]);
            $id = 'grid-' . Inflector::camel2id(StringHelper::basename($this->searchModelClass)) . '-' . $attribute;
//            $modelRel = $rel[2] ? lcfirst(Inflector::pluralize($rel[1])) : lcfirst($rel[1]);
           if ($column->allowNull)
           { $output = "[
                'attribute' => '$attribute',
                'label' => " . $this->generateString(ucwords(Inflector::humanize($rel[5]))) . ",
                'value' => function(\$model){
                    if (\$model->$rel[7])
                    {return \$model->$rel[7]->$labelCol;}
                    else
                    {return NULL;}
                },
                'filterType' => GridView::FILTER_SELECT2,
                'filter' => \\yii\\helpers\\ArrayHelper::map(\\$this->nsModel\\$rel[1]::find()->asArray()->all(), '{$rel[self::REL_PRIMARY_KEY]}', '$labelCol'),
                'filterWidgetOptions' => [
                    'pluginOptions' => ['allowClear' => true],
                ],
                'filterInputOptions' => ['placeholder' => '$humanize', 'id' => '$id']
            ],\n";
           return $output;
           }
           else 
           { $output = "[
                'attribute' => '$attribute',
                'label' => " . $this->generateString(ucwords(Inflector::humanize($rel[5]))) . ",
                'value' => function(\$model){                   
                    return \$model->$rel[7]->$labelCol;                   
                },
                'filterType' => GridView::FILTER_SELECT2,
                'filter' => \\yii\\helpers\\ArrayHelper::map(\\$this->nsModel\\$rel[1]::find()->asArray()->all(), '{$rel[self::REL_PRIMARY_KEY]}', '$labelCol'),
                'filterWidgetOptions' => [
                    'pluginOptions' => ['allowClear' => true],
                ],
                'filterInputOptions' => ['placeholder' => '$humanize', 'id' => '$id']
            ],\n";
           return $output;                          
           }
        } else {
            return "'$attribute" . ($format === 'text' ? "" : ":" . $format) . "',\n";
        }
    }
638176
@Override
	public Object getValueAt(final int row, final int visibleColumnIndex) {
		final int actualIndex = this.visibilityManager.getActualIndexFromVisibleIndex(visibleColumnIndex);
		return getRecords().get(row).getColumnValue(actualIndex);
	}
1144221
protected function selectOnlyNeededColumns(array $data)
    {
        if (is_null($this->onlyColumns)) {
            return $data;
        } else {
            return array_intersect_key($data, array_flip(array_merge($this->onlyColumns, $this->exceptions)));
        }
    }
695392
def visibleColumns(self):
        
        return [self.columnOf(c) for c in range(self.columnCount()) \
                if not self.isColumnHidden(c)]
822982
public function createHtmlTableFromArray($nbColonnes=4,$styleTableau='border:1px;',$classTableau='',$cellProperty='',$tableauProperties='')
	{
	
		$htmlClassTableau = "";
		if($classTableau!='')
			$htmlClassTableau = " class='".$classTableau."' ";
	
		$html="<table style=\"".$styleTableau."\" ".$htmlClassTableau." ".$tableauProperties."><tbody>";
		
		
		$nbValues = count($this->tabValues);
		
		// calcul du nombre de cases totales :
		if($nbValues%$nbColonnes==0)
		{
			$nbLignes = $nbValues / $nbColonnes;
		}
		else
		{
			$nbLignes = intval($nbValues / $nbColonnes)+1;
		}
		
		$nbCases = $nbLignes * $nbColonnes;
		
		$ligne=0; // coordonn�es horizontales
		$colonne=0; // coordonn�es verticales
		for($i=0 ; $i<$nbCases ; $i++)
		{
			if($colonne==0)
			{
				$html.="<tr>";
			}
			
			if(isset($this->tabValues[$i]))
			{
				if(isset($this->tabStyles[$i]) && $this->tabStyles[$i]!='')
					$html.="<td ".$this->tabStyles[$i].">".$this->tabValues[$i]."</td>";
				else
					$html.="<td ".$cellProperty.">".$this->tabValues[$i]."</td>";
			}
			else
			{
				$html.="<td ".$cellProperty.">&nbsp;</td>";
			}
			
			
			if($colonne==$nbColonnes-1)
			{
				$html.="</tr>";
				$colonne=0;
				$ligne+=1;
			}
			else
			{
				$colonne+=1;
			}
		}
		
		$html=$html."</tbody></table>";
		return $html;
	}
621503
public function visible($visible = [], $override = false)
    {
        $this->each(function ($model) use ($visible, $override) {
            /** @var Model $model */
            $model->visible($visible, $override);
        });

        return $this;
    }
677266
private function tableFactory($isRead = true)
    {
        $table = $operator = '';
        $cacheKey = [];
        foreach ($this->table as $key => $val) {
            $realTable = $this->getRealTableName($key);
            $cacheKey[] = $isRead ? $this->getCacheVer($realTable) : $realTable;

            $on = null;
            if (isset($this->join[$key])) {
                $operator = ' INNER JOIN';
                $on = $this->join[$key];
            } elseif (isset($this->leftJoin[$key])) {
                $operator = ' LEFT JOIN';
                $on = $this->leftJoin[$key];
            } elseif (isset($this->rightJoin[$key])) {
                $operator = ' RIGHT JOIN';
                $on = $this->rightJoin[$key];
            } else {
                empty($table) || $operator = ' ,';
            }
            if (is_null($val)) {
                $table .= "{$operator} {$realTable}";
            } else {
                $table .= "{$operator} {$realTable} AS `{$val}`";
            }
            isset($this->forceIndex[$realTable]) && $table .= ' force index(' . $this->forceIndex[$realTable] . ') ';
            is_null($on) || $table .= " ON {$on}";
        }

        if (empty($table)) {
            throw new \InvalidArgumentException(Lang::get('_PARSE_SQL_ERROR_NO_TABLE_', $isRead ? 'select' : 'update/delete'));
        }
        return [$table, $cacheKey];
    }
615610
private function getSearchableColumnNames(TableMetadata $tableMetadata): array
    {
        $columnNameList = [];
        foreach ($tableMetadata->getAllColumnMetadata() as $columnMetadata) {
            if ($columnMetadata->isStringType()) {
                $columnNameList[] = $columnMetadata->getColumnName();
            }
        }
        return $columnNameList;
    }
1040083
public function visibleColumnNames()
    {
        $visible = array_filter(explode(',', request(Tools\ColumnSelector::SELECT_COLUMN_NAME)));

        if (empty($visible)) {
            return $this->columnNames;
        }

        array_push($visible, '__row_selector__', '__actions__');

        return collect($this->columnNames)->filter(function ($column) use ($visible) {
            return in_array($column, $visible);
        });
    }
74106
protected static function validateSortByField(string $data, array $fields, array $displayColumns, RepositoryInterface $table): string
    {
        /** @var \Cake\ORM\Table */
        $table = $table;
        // use sort field if is searchable
        if (in_array($data, $fields)) {
            return $data;
        }

        // set display field as sort field
        $data = $table->getDisplayField();

        // check if display field exists in the database table
        if ($table->getSchema()->getColumn($data)) {
            return $table->aliasField($data);
        }

        // use first display column which exists in the database table
        foreach ($displayColumns as $displayColumn) {
            // remove table prefix
            list(, $displayColumn) = explode('.', $displayColumn);
            if (!$table->getSchema()->getColumn($displayColumn)) {
                continue;
            }

            return $table->aliasField($displayColumn);
        }

        // use primary key as a last resort
        return $table->aliasField(current((array)$table->getPrimaryKey()));
    }
576991
public function getVisibleColumns()
    {
        $definitions = $this->defineListColumns();
        $columns = [];

        /*
         * Supplied column list
         */
        if ($this->columnOverride === null) {
            $this->columnOverride = $this->getSession('visible', null);
        }

        if ($this->columnOverride && is_array($this->columnOverride)) {

            $invalidColumns = array_diff($this->columnOverride, array_keys($definitions));
            if (!count($definitions)) {
                throw new ApplicationException(Lang::get(
                    'backend::lang.list.missing_column',
                    ['columns'=>implode(',', $invalidColumns)]
                ));
            }

            $availableColumns = array_intersect($this->columnOverride, array_keys($definitions));
            foreach ($availableColumns as $columnName) {
                $definitions[$columnName]->invisible = false;
                $columns[$columnName] = $definitions[$columnName];
            }
        }
        /*
         * Use default column list
         */
        else {
            foreach ($definitions as $columnName => $column) {
                if ($column->invisible) {
                    continue;
                }

                $columns[$columnName] = $definitions[$columnName];
            }
        }

        return $this->visibleColumns = $columns;
    }
965328
public static function addColumn(TableNode $table, array $columnData): TableNode
    {
        $headers = array_keys($columnData);

        $newParameters = $table->getTable();

        foreach ($headers as $header) {
            $row = array_keys($table->getTable())[0];
            $newParameters[$row++][] = $header;
            if (\is_array($columnData[$header])) {
                foreach ($columnData[$header] as $value) {
                    $newParameters[$row++][] = $value;
                }
            } else {
                $newParameters[$row][] = $columnData[$header];
            }
        }

        return new self($newParameters);
    }