Sets up the default columns for given index.
This method should be used in case there is no way to find actual columns,
like in some distributed indexes.
@param IndexSchema $index the index metadata
@since 2.0.6
557828
protected function applyDefaultColumns($index)
    {
        $column = $this->loadColumnSchema([
            'Field' => 'id',
            'Type' => 'bigint',
        ]);
        $index->columns[$column->name] = $column;
        $index->primaryKey = 'id';
    }
474927
public function forgetIndex(AbstractIndex $index)
    {
        foreach ($this->indexes as $name => $indexSchema) {
            if ($indexSchema == $index) {
                unset($this->indexes[$name]);
                break;
            }
        }
    }
137398
private function addUsedIndex(string $index)
    {
        // add user index and detect default translate (default: index == translate)
        $this->listUsedIndex[$index] = (isset($this->dictionary[$index]) && $this->dictionary[$index] != $index);
    }
592243
public function setColumns(array $indexColumns)
    {
        $this->indexColumns = array();
        $this->indexColumnSizes = array();
        foreach ($indexColumns as $col) {
            $this->addColumn($col);
        }
    }
868408
public function setIndex($index): self
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }
        $this->_metadata['_index'] = $index;

        return $this;
    }
1358168
protected function addArrValue($index)
    {
        $class_name = $this->fields[$index];
        $real_class_name = __NAMESPACE__ . "\\" . $class_name;
        return $this->values[$index][] = new $real_class_name();
    }
1078541
public function setColumns(array $columns)
    {
        // add columns
        foreach($columns['add'] as $key => $value) {
            $this->dataTables->addColumn($key, $value);
        }

        // edit columns
        foreach($columns['edit'] as $key => $value) {
            $this->dataTables->editColumn($key, $value);
        }

        // remove columns
        foreach($columns['remove'] as $value) {
            $this->dataTables->removeColumn($value);
        }
    }
674450
public static function remove($index)
    {
        if (isset(self::$views[$index])) {
            self::$views[$index] = null;
        }
    }
34164
private function reindexAtomically(Index $index, array $algoliaRecords)
    {
        $temporaryIndexName = 'tmp_' . $index->indexName;

        $temporaryIndex = $this->initIndex($temporaryIndexName);
        $temporaryIndex->addObjects($algoliaRecords);

        $settings = $index->getSettings();

        // Temporary index overrides all the settings on the main one.
        // So we need to set the original settings on the temporary one before atomically moving the index.
        $temporaryIndex->setSettings($settings);

        return $this->moveIndex($temporaryIndexName, $index->indexName);
    }
670822
protected function setColumns()
    {
        // choose what columns should be displayed in the table.
        // For table display, we need to specify the column name for the result query.

        $this->addCheckableColumn();

        $this->columns['id'] = array(
            'label'         => 'ID',
            'sortable'      => true,
            'table_column'  => 'users.id',
        );

        $this->columns['username'] = array(
            'label'     => 'Username',
            'sortable'  => true,
            'table_column'  => 'users.username',
        );

        $this->columns['email'] = array(
            'label'         => 'Email',
            'sortable'      => true,
            'classes'       => 'some_class some_class2',
            'table_column'  => 'users.email',
            'thead_attr'    => 'style="width:200px" data-some-attr="example"',
        );

        $this->columns['created_at'] = array(
            'label'         => 'Created At',
            'sortable'      => true,
            'table_column'  => 'users.created_at',
        );

        $this->addActionColumn();

    }
1103546
protected function assignIndexes($indexes)
    {
        foreach ($indexes as $index) {
            if (!$index instanceof IndexInterface) {
                throw new ModelException(sprintf('Index must be an instance of IndexInterface, got "%s"', $this->getType($index)));
            }

            foreach ($index->fields() as $key => $field) {
                $field = $index->type() == 'foreign' ? $key : $field;

                $this->assertField($field);
            }

            if ($index->type() !== 'foreign') {
                $index->table($this->table);
            }

            $this->indexes[$index->name()] = $index;
        }
    }
174110
public function formatTableIndex($index, array $columns) {
        return sprintf($this->getClause(self::INDEX), $this->quote($index), $this->quoteList($columns));
    }
1115624
public function initDefaultProperties()
    {
        if (isset($this->schema) && $this->setPropertyDefaultValue($this->schema)) {
            $this->property_value = $this->schema->default;
        }
    }
157455
public function setIndices( $indices )
	{
		foreach( $indices as $index )
		{
			if( !in_array( $index, $this->columns ) )
				throw new \InvalidArgumentException( 'Column "'.$index.'" is not existing in table "'.$this->tableName.'" and cannot be an index' );
			if( $index === $this->primaryKey )
				throw new \InvalidArgumentException( 'Column "'.$index.'" is already primary key and cannot be an index' );
		}
		$this->indices	= $indices;
		array_unique( $this->indices );
	}
1155480
public function addIndex($columnName, $type = Table::INDEX_REGULAR) {
        if (!array_key_exists($columnName, $this->getIndexes()) && !array_key_exists($columnName,
                        $this->newIndexes))
                $this->newIndexes[$columnName] = $type;
        return $this;
    }
1312808
public function setIndex($index): self
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }

        $this->_index = (string) $index;

        return $this;
    }
444205
final String getColumnDefaultValue(int index) {
        if (m_extraMetadata != null) {
            return m_extraMetadata.originalColumnInfos[index].defaultValue;
        }
        return null;
    }