Returns the table name in the class hierarchy which contains a given
field column for a {@link DataObject}. If the field does not exist, this
will return null.

@param string $candidateClass
@param string $fieldName

@return string
11118
public function tableForField($candidateClass, $fieldName)
    {
        $class = $this->classForField($candidateClass, $fieldName);
        if ($class) {
            return $this->tableName($class);
        }
        return null;
    }
722439
public static String getClassNameFromTableModel(TableModel model) {
		DialectException.assureNotNull(model, "TableModel can not be null");
		String className;
		if (model.getEntityClass() != null)
			className = model.getEntityClass().getSimpleName();
		else {
			DialectException.assureNotEmpty(model.getTableName(), "TableName can not be empty in TableModel");
			className = StrUtils.toUpperCaseFirstOne(transColumnNameToFieldName(model.getTableName()));
		}
		DialectException.assureNotEmpty(className, "TableName can not be empty in TableModel");
		return className;
	}
802682
public function GetColumnName($objectclass, $propertyname)
	{
		$fm = $this->GetFieldMap($objectclass, $propertyname);
		return $fm->ColumnName;
	}
127841
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "ID")
    public QualifiedName getId() {
        return id;
    }
1163183
public ColumnModel getColumnByFieldName(String fieldName) {
		for (ColumnModel columnModel : columns)
			if (columnModel.getEntityField() != null && columnModel.getEntityField().equalsIgnoreCase(fieldName))
				return columnModel;
		return null;
	}
1102410
private function getField($columnName) {
        foreach($this->getFields() as $field) {
            if($field->getName() == $columnName) {
                return $field;
            }
        }
        echo 'Could Not Find Field '.$this->getTableName().'.'.$columnName."\n";
        return false;
    }
73434
public function getColumnByPhpName($phpName)
    {
        if (!isset($this->columnsByPhpName[$phpName])) {
            throw new PropelException("Cannot fetch ColumnMap for undefined column phpName: " . $phpName);
        }

        return $this->columnsByPhpName[$phpName];
    }
916092
public function getSingleAssociationJoinColumnName($fieldName)
    {
        if ( ! $this->isAssociationWithSingleJoinColumn($fieldName)) {
            throw MappingException::noSingleAssociationJoinColumnFound($this->name, $fieldName);
        }
        return $this->associationMappings[$fieldName]['joinColumns'][0]['name'];
    }
722751
public function cuGetFieldInfo($tableName, $fieldName)
    {

        /** @noinspection SqlNoDataSourceInspection */
        $query  = 'SELECT `%s` FROM `%s`;';
        $query  = sprintf($query, $fieldName, $tableName);
        $result = $this->query($query);

        return $result->fetch_field_direct(0);
    }
298731
protected function getSelectColumnsSQL()
    {
        // Create the column list fragment only once
        if ($this->currentPersisterContext->selectColumnListSql !== null) {
            return $this->currentPersisterContext->selectColumnListSql;
        }

        $columnList         = array();
        $discrColumn        = $this->class->discriminatorColumn['name'];
        $baseTableAlias     = $this->getSQLTableAlias($this->class->name);
        $resultColumnName   = $this->platform->getSQLResultCasing($discrColumn);

        $this->currentPersisterContext->rsm->addEntityResult($this->class->name, 'r');
        $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
        $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumn);

        // Add regular columns
        foreach ($this->class->fieldMappings as $fieldName => $mapping) {
            $class = isset($mapping['inherited'])
                ? $this->em->getClassMetadata($mapping['inherited'])
                : $this->class;

            $columnList[] = $this->getSelectColumnSQL($fieldName, $class);
        }

        // Add foreign key columns
        foreach ($this->class->associationMappings as $mapping) {
            if ( ! $mapping['isOwningSide'] || ! ($mapping['type'] & ClassMetadata::TO_ONE)) {
                continue;
            }

            $tableAlias = isset($mapping['inherited'])
                ? $this->getSQLTableAlias($mapping['inherited'])
                : $baseTableAlias;

            foreach ($mapping['targetToSourceKeyColumns'] as $srcColumn) {
                $className = isset($mapping['inherited'])
                    ? $mapping['inherited']
                    : $this->class->name;

                $targetClass = $this->em->getClassMetadata($mapping['targetEntity']);

                $columnList[] = $this->getSelectJoinColumnSQL(
                    $tableAlias,
                    $srcColumn,
                    $className,
                    PersisterHelper::getTypeOfColumn(
                        $mapping['sourceToTargetKeyColumns'][$srcColumn],
                        $targetClass,
                        $this->em
                    )
                );
            }
        }

        // Add discriminator column (DO NOT ALIAS, see AbstractEntityInheritancePersister#processSQLResult).
        $tableAlias = ($this->class->rootEntityName == $this->class->name)
            ? $baseTableAlias
            : $this->getSQLTableAlias($this->class->rootEntityName);

        $columnList[] = $tableAlias . '.' . $discrColumn;

        // sub tables
        foreach ($this->class->subClasses as $subClassName) {
            $subClass   = $this->em->getClassMetadata($subClassName);
            $tableAlias = $this->getSQLTableAlias($subClassName);

            // Add subclass columns
            foreach ($subClass->fieldMappings as $fieldName => $mapping) {
                if (isset($mapping['inherited'])) {
                    continue;
                }

                $columnList[] = $this->getSelectColumnSQL($fieldName, $subClass);
            }

            // Add join columns (foreign keys)
            foreach ($subClass->associationMappings as $mapping) {
                if ( ! $mapping['isOwningSide']
                        || ! ($mapping['type'] & ClassMetadata::TO_ONE)
                        || isset($mapping['inherited'])) {
                    continue;
                }

                foreach ($mapping['targetToSourceKeyColumns'] as $srcColumn) {
                    $className = isset($mapping['inherited'])
                        ? $mapping['inherited']
                        : $subClass->name;

                    $targetClass = $this->em->getClassMetadata($mapping['targetEntity']);

                    $columnList[] = $this->getSelectJoinColumnSQL(
                        $tableAlias,
                        $srcColumn,
                        $className,
                        PersisterHelper::getTypeOfColumn(
                            $mapping['sourceToTargetKeyColumns'][$srcColumn],
                            $targetClass,
                            $this->em
                        )
                    );
                }
            }
        }

        $this->currentPersisterContext->selectColumnListSql = implode(', ', $columnList);

        return $this->currentPersisterContext->selectColumnListSql;
    }
527935
public function getTableName(
        string $modelEntity,
        string $connectionName = ResourceConnection::DEFAULT_CONNECTION
    ): string {
        return $this->resourceConnection->getTableName($modelEntity, $connectionName);
    }
1171283
public static function quoteIdentifier($identifier, $tableName = null)
    {
        if ($identifier === null || $identifier === '') {
            return '';
        }

        if (!is_string($identifier)) {
            throw new InvalidArgumentException(sprintf(
                'Field Name must be a string, received %s',
                is_object($identifier) ? get_class($identifier) : gettype($identifier)
            ));
        }

        if ($tableName !== null) {
            if (!is_string($tableName)) {
                throw new InvalidArgumentException(sprintf(
                    'Table Name must be a string, received %s',
                    is_object($tableName) ? get_class($tableName) : gettype($tableName)
                ));
            }

            if ($tableName === '') {
                throw new InvalidArgumentException(
                    'Table Name can not be empty.'
                );
            }

            if ($identifier === '*') {
                $template = '%1$s.*';
            } else {
                $template = '%1$s.`%2$s`';
            }

            return sprintf($template, $tableName, $identifier);
        }

        if ($identifier === '*') {
            return $identifier;
        } else {
            return sprintf('`%1$s`', $identifier);
        }
    }
727214
public function getFieldName($columnName)
    {
        return isset($this->fieldNames[$columnName]) ?
                $this->fieldNames[$columnName] : $columnName;
    }
1291532
public function getField($fieldName)
    {
        if (array_key_exists($fieldName, $this->_message)) {
            return $this->_message[$fieldName];
        } else {
            return null;
        }
    }
723840
public function getSingleAssociationReferencedJoinColumnName($fieldName)
    {
        if ( ! $this->isAssociationWithSingleJoinColumn($fieldName)) {
            throw MappingException::noSingleAssociationJoinColumnFound($this->name, $fieldName);
        }
        return $this->associationMappings[$fieldName]['joinColumns'][0]['referencedColumnName'];
    }
783564
final private static function getColumnType($fieldName) {
		
		$db = Database::getInstance();
		$column = $db->describeColumn(static::TABLE_NAME, $fieldName);
		
		if (is_null($column)) {
			return NULL;
		}
		
		// split the column Type to recognize field type and length
		preg_match('#^([\w]+)(\([^\)]+\))? ?(unsigned)?#i', $column->Type, $matches);
		
		$field = new \stdClass();
		
		$field->name	= $fieldName;
		$field->type	= $matches[1];
		$field->unsigned= (isset($matches[3]));
		$field->nullable= 'YES' == $column->Null ? TRUE : FALSE;
		$field->key		= $column->Key;
		$field->default	= $column->Default;
		$field->extra	= $column->Extra;

		if (isset($matches[2])) {
			if (in_array($field->type, ['enum','set'])) {
				$field->length = explode("','", substr($matches[2], 2, -2));
			} else {
				$field->length = explode(",", substr($matches[2], 1, -1));
			}
		} else {
			$field->length = NULL;
		}
		
		return $field;
		
	}
211991
protected function generateClassName($tableName)
    {
        if (isset($this->_classNames[$tableName])) {
            return $this->_classNames[$tableName];
        }

        if (($pos = strrpos($tableName, '.')) !== false) {
            $tableName = substr($tableName, $pos + 1);
        }

        $db = $this->getDbConnection();
        $patterns = [];
        $patterns[] = "/^{$db->tablePrefix}(.*?)$/";
        $patterns[] = "/^(.*?){$db->tablePrefix}$/";
        if (strpos($this->tableName, '*') !== false) {
            $pattern = $this->tableName;
            if (($pos = strrpos($pattern, '.')) !== false) {
                $pattern = substr($pattern, $pos + 1);
            }
            $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/';
        }
        $className = $tableName;
        foreach ($patterns as $pattern) {
            if (preg_match($pattern, $tableName, $matches)) {
                $className = $matches[1];
                break;
            }
        }

        return $this->_classNames[$tableName] = Inflector::id2camel($className, '_');
    }