Adds all fields of the given class to the result set mapping (columns and meta fields).

@param string[] $customRenameColumns

@throws InvalidArgumentException
335522
protected function addAllClassFields(string $class, string $alias, array $customRenameColumns, int $renameMode) : void
    {
        /** @var ClassMetadata $classMetadata */
        $classMetadata = $this->em->getClassMetadata($class);
        $platform      = $this->em->getConnection()->getDatabasePlatform();

        if (! $this->isInheritanceSupported($classMetadata)) {
            throw new InvalidArgumentException(
                'ResultSetMapping builder does not currently support your inheritance scheme.'
            );
        }

        foreach ($classMetadata->getDeclaredPropertiesIterator() as $property) {
            switch (true) {
                case $property instanceof FieldMetadata:
                    $columnName  = $property->getColumnName();
                    $columnAlias = $platform->getSQLResultCasing(
                        $this->getColumnAlias($columnName, $renameMode, $customRenameColumns)
                    );

                    if (isset($this->fieldMappings[$columnAlias])) {
                        throw new InvalidArgumentException(
                            sprintf("The column '%s' conflicts with another column in the mapper.", $columnName)
                        );
                    }

                    $this->addFieldResult($alias, $columnAlias, $property->getName());
                    break;

                case $property instanceof ToOneAssociationMetadata && $property->isOwningSide():
                    $targetClass = $this->em->getClassMetadata($property->getTargetEntity());

                    foreach ($property->getJoinColumns() as $joinColumn) {
                        /** @var JoinColumnMetadata $joinColumn */
                        $columnName           = $joinColumn->getColumnName();
                        $referencedColumnName = $joinColumn->getReferencedColumnName();
                        $columnAlias          = $platform->getSQLResultCasing(
                            $this->getColumnAlias($columnName, $renameMode, $customRenameColumns)
                        );

                        if (isset($this->metaMappings[$columnAlias])) {
                            throw new InvalidArgumentException(
                                sprintf("The column '%s' conflicts with another column in the mapper.", $columnName)
                            );
                        }

                        if (! $joinColumn->getType()) {
                            $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
                        }

                        $this->addMetaResult($alias, $columnAlias, $columnName, $property->isPrimaryKey(), $joinColumn->getType());
                    }
                    break;
            }
        }
    }
289790
public function addColumn($column)
    {
        if (is_string($column) && class_exists($column)) {
            $column = new $column();
        }

        if (!$column instanceof Column) {
            throw new \InvalidArgumentException(__METHOD__ . ' argument 1 need Column instance.');
        }

        $this->columns[$column->getName()] = $column;

        return $column;
    }
830545
public function addLocalColumnName($localColumnName)
    {
        if (!is_string($localColumnName) || (strlen($localColumnName) <= 0)) {
            throw SchemaException::invalidForeignKeyLocalColumnName($this->getName());
        }

        $this->localColumnNames[] = $localColumnName;
    }
659893
private function getColumnAlias($columnName, $mode, array $customRenameColumns)
    {
        switch ($mode) {
            case self::COLUMN_RENAMING_INCREMENT:
                return $columnName . $this->sqlCounter++;

            case self::COLUMN_RENAMING_CUSTOM:
                return isset($customRenameColumns[$columnName])
                    ? $customRenameColumns[$columnName] : $columnName;

            case self::COLUMN_RENAMING_NONE:
                return $columnName;

        }
    }
111246
protected function addToForm(CustomField $customfield)
    {
        if (!$customfield->formAutoDisplay()) {
            return false;
        }
        $field = $customfield->setModel($this->grid->row);


        $this->grid->fieldset(function (Fieldset $fieldset) use($field) {
            $fieldset->add($field);
        });

        $this->grid->rules(array_merge($this->grid->rules, $field->getRules()));

        $this->grid->row->saved(function($row) use($field) {

            $field->onSave($row);
        });



        return $this;
    }
907937
public function setLeftColumnName(string $leftColumnName): void
    {
        $leftColumnName = trim($leftColumnName);

        if (empty($leftColumnName)) {
            throw new InvalidArgumentException('leftColumnName cannot be empty');
        }

        $this->leftColumnName = $leftColumnName;
    }
799802
public function setIdColumnName(string $idColumnName): void
    {
        $idColumnName = trim($idColumnName);

        if (empty($idColumnName)) {
            throw new InvalidArgumentException('idColumnName cannot be empty');
        }

        $this->idColumnName = $idColumnName;
    }
440456
protected function setFields($fields)
    {
        if(is_array($fields)) {
            foreach ( $fields as $field ) {
                if ( !in_array($field, $this->fieldsWhitelist) ) {
                    throw new \InvalidArgumentException(sprintf('The field `%s` was not recognized.', $field));
                }
            }
        } elseif($fields === true) {
            $fields = $this->fieldsWhitelist;
        } else {
            throw new \InvalidArgumentException("The argument passed to setFields was invalid");
        }

        $this->setQueryParam('fields', $fields);
    }
570283
private function convertColumnsToRawFields(array $columns) {
        $columnMaps = $this->getModelsMetaData()->getColumnMap($this);
        foreach($columns as $key => $value) {
            if(!array_key_exists($value, $columnMaps)) {
                //Look up in the changed values
                $index = array_search($value, $columnMaps);
                if($index === false) {
                    throw new \InvalidArgumentException('Invalid Column, could not find: ' . $value);
                } else {
                    $columns[$key] = $index;
                }
            }
        }
        return $columns;
    }
521533
public function addColumnValues(array $columnNamesToValues) : self
    {
        $this->columnNamesToValues = array_merge($this->columnNamesToValues, $columnNamesToValues);

        return $this;
    }
758289
public function setAssignNonMappedColumns($assignNonMappedColumns)
    {
        if (empty($this->mappingOptions)) $this->resetMappingOptions();

        $this->mappingOptions->assignNonMappedColumns = $assignNonMappedColumns;

        return $this;
    }
129079
public function putFieldsInColumn($column, array $fields = array())
    {
        if ($column < 0 || $column > 2)
        {
            throw new InvalidColumnIndex($column);
        }
        if (!array_key_exists($column, $this->_fields))
        {
            $this->_fields[$column] = array();
        }
        $this->_fields[$column] = array_merge($this->_fields[$column], $fields);
    }
672159
public function addRow(string ...$columns){
        if($this->count !== count($columns)){
            throw new \InvalidArgumentException();
        }

        $this->body[]   = $columns;

        return $this;
    }
1253203
private function buildFieldMappings(Mapping\ClassMetadata $metadata)
    {
        $tableName      = $metadata->getTableName();
        $columns        = $this->tables[$tableName]->getColumns();
        $primaryKeys    = $this->getTablePrimaryKeys($this->tables[$tableName]);
        $foreignKeys    = $this->getTableForeignKeys($this->tables[$tableName]);
        $allForeignKeys = [];

        foreach ($foreignKeys as $foreignKey) {
            $allForeignKeys = array_merge($allForeignKeys, $foreignKey->getLocalColumns());
        }

        $ids = [];

        foreach ($columns as $column) {
            if (in_array($column->getName(), $allForeignKeys, true)) {
                continue;
            }

            $fieldName     = $this->getFieldNameForColumn($tableName, $column->getName(), false);
            $fieldMetadata = $this->convertColumnAnnotationToFieldMetadata($tableName, $column, $fieldName);

            if ($primaryKeys && in_array($column->getName(), $primaryKeys, true)) {
                $fieldMetadata->setPrimaryKey(true);

                $ids[] = $fieldMetadata;
            }

            $metadata->addProperty($fieldMetadata);
        }

        // We need to check for the columns here, because we might have associations as id as well.
        if ($ids && count($primaryKeys) === 1) {
            $ids[0]->setValueGenerator(new Mapping\ValueGeneratorMetadata(Mapping\GeneratorType::AUTO));
        }
    }
633088
public function withPredefinedColumnValues(FieldBuilderBase $field, array $columnValues) : TableRowFieldDefiner
    {
        $this->fieldBuilder->attr(TableType::ATTR_PREDEFINED_COLUMNS, array_values($columnValues));
        return $this->withColumnKeyAs($field);
    }
202583
protected function validateColumns( &$columns )
	{
		if( is_string( $columns ) && $columns )
			$columns	= array( $columns );
		else if( is_array( $columns ) && !count( $columns ) )
			$columns	= array( '*' );
		else if( $columns === NULL || $columns == FALSE )
			$columns	= array( '*' );

		if( !is_array( $columns ) )
			throw new \InvalidArgumentException( 'Column keys must be an array of column names, a column name string or "*"' );
		foreach( $columns as $column )
			if( $column != '*' && !in_array( $column, $this->columns ) )
				throw new \InvalidArgumentException( 'Column key "'.$column.'" is not a valid column of table "'.$this->tableName.'"' );
	}
1326567
public function appendColumnToUniqueIndexes(string $columnName)
    {
        if (!isset($this->columns[$columnName])) {
            throw InvalidArgumentException::format(
                'Invalid column name supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues(array_keys($this->columns)), $columnName
            );
        }

        foreach ($this->indexes as $key => $index) {
            if ($index->isUnique()) {
                $this->indexes[$key] = new Index(
                    $index->getName(),
                    true,
                    array_unique(array_merge($index->getColumnNames(), [$columnName]))
                );
            }
        }
    }