table = $table; $this->columns = $columns; $this->indexType = $indexType; $this->nameWithoutPrefix = $nameWithoutPrefix; } /** * Return columns in order, in which they should go in composite index. * * @return Column[] */ public function getColumns() { return $this->columns; } /** * {@inheritdoc} */ public function getTable() { return $this->table; } /** * {@inheritdoc} */ public function getDiffSensitiveParams() { return [ 'type' => $this->getType(), 'columns' => $this->getColumnNames(), 'indexType' => $this->getIndexType() ]; } /** * Retrieve array with column names from column objects collections. * * @return array */ public function getColumnNames() { return array_map( function (Column $column) { return $column->getName(); }, $this->getColumns() ); } /** * {@inheritdoc} */ public function getElementType() { return self::TYPE; } /** * Get index type (FULLTEXT, BTREE, HASH). * * @return string */ public function getIndexType() { return $this->indexType; } /** * Retrieve the index name which is calculated without table prefix. * * @return string */ public function getNameWithoutPrefix() { return $this->nameWithoutPrefix; } }