Returns the migration class path by key

@param string $table
@param string|null $field
@return string
496795
public function getMigrationClassPathByKey($table, $field = null)
    {
        $name = is_null($field) ?
            $this->getTableMigrationName($table) :
            $this->getTableFieldMigrationName($field, $table);

        return $this->getMigrationClassPath($name);
    }
491628
protected function getSearchField($table, $field)
    {
        if ($field == 'oxlongdesc') {
            $searchField = getViewName('oxartextends', $this->_iLanguage) . ".{$field}";
        } else {
            $searchField = "{$table}.{$field}";
        }
        return $searchField;
    }
132760
public function findForeignKeys ($table, $column = null)
		{
			$query = ( new  Query )
				->select('CONSTRAINT_NAME')
				->from('INFORMATION_SCHEMA.KEY_COLUMN_USAGE')
				->where([
					'TABLE_SCHEMA' => $this->getDbName(),
					'TABLE_NAME'   => $table
				]);
			if (!is_null($column))
				$query->andWhere([ 'COLUMN_NAME' => $column ]);

			return $query->column();
		}
688526
public static function getCsvField(RepositoryInterface $table, string $field) : ?CsvField
    {
        if ('' === $field) {
            return null;
        }

        $moduleName = App::shortName(get_class($table), 'Model/Table', 'Table');

        $config = new ModuleConfig(ConfigType::MIGRATION(), $moduleName);
        $parsed = $config->parse();

        if (! property_exists($parsed, $field)) {
            return null;
        }

        $parsed = json_encode($parsed->{$field});
        if (false === $parsed) {
            return null;
        }

        return new CsvField(json_decode($parsed, true));
    }
1022667
public function getField($field)
    {
        return isset($this->data[$field]) ? $this->data[$field] : null;
    }
905944
public static function getDeleted(Field $field)
    {
        $change = new FieldMigrationChange();

        $change->isDeleted = true;
        $change->field = $field;

        return $change;
    }
26438
public static function getLastId($table, $field) {

        try {
            $sql = 'SELECT max(' . $field . ') as lastid FROM ' . $table;
            list($lastid) = self::dbFetch(self::query($sql), "num"); // cause warning when use assoc array
            return (int) $lastid;
        } catch (Exception $e) {
            echo $e->getTraceAsString();
        }        
    }
133836
public function getPrimaryKey($table)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $query = $this->utility();
        $results = $this->getColumns($table, "`Key` = 'PRI'");
        return isset($results[0]['Field']) ? $results[0]['Field'] : null;
    }
435232
public function getField($field)
    {
        // Skip invalid fields
        $fields = $this->compositeDatabaseFields();
        if (!isset($fields[$field])) {
            return null;
        }

        // Check bound object
        if ($this->record instanceof DataObject) {
            $key = $this->getName() . $field;
            return $this->record->getField($key);
        }

        // Check local record
        if (isset($this->record[$field])) {
            return $this->record[$field];
        }
        return null;
    }
134137
public function getField($field)
    {
        if (!$this->isFieldSupported($field)) {
            return null;
        }

        if (!$this->hasLoadedField($field)) {
            $loaderData = $this->getLoaderData($field);
            if (isset($this->normalizersMap[$field])) {
                $normalizerName = $this->normalizersMap[$field];
                $normalizerFunction = sprintf('%sNormalizer', $normalizerName);
                $this->fields[$field] = $this->$normalizerFunction($loaderData);
            } else {
                $this->fields[$field] = $loaderData;
            }
        }

        return parent::getField($field);
    }
632167
protected function parseFieldName($field, $table = false){
		// preg_replace callback behaviour
		if(is_array($field))
			$field = $field[0];
		if($field instanceof Literal)
			return $field->value;

		$field = trim($field);

		if($field === '*')
			return $field;

		if(strpos($field, ' '))
			return $field;

		$field = str_replace(':', '', $field);

		if(strpos($field, '.') !== false || $table === true){
			$prefix = $this->stmt->getConnection()->getPrefix();
			$field = $prefix . $field;
		}

		return $this->stmt->getConnection()->getDriver()->escape($field, Manager::IDENTIFIER);
	}
908980
public function getJsonFieldType($field)
    {
        return isset($this->options['field_type'][$field]) ? $this->options['field_type'][$field] : null;
    }
1088165
private function getTypes($field, $value, ClassMetadata $class)
    {
        $property = $class->getProperty($field);
        $types    = [];

        switch (true) {
            case $property instanceof FieldMetadata:
                $types = array_merge($types, [$property->getType()]);
                break;

            case $property instanceof AssociationMetadata:
                $class = $this->em->getClassMetadata($property->getTargetEntity());

                if (! $property->isOwningSide()) {
                    $property = $class->getProperty($property->getMappedBy());
                    $class    = $this->em->getClassMetadata($property->getTargetEntity());
                }

                $joinColumns = $property instanceof ManyToManyAssociationMetadata
                    ? $property->getJoinTable()->getInverseJoinColumns()
                    : $property->getJoinColumns();

                foreach ($joinColumns as $joinColumn) {
                    /** @var JoinColumnMetadata $joinColumn */
                    $referencedColumnName = $joinColumn->getReferencedColumnName();

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

                    $types[] = $joinColumn->getType();
                }

                break;

            default:
                $types[] = null;
                break;
        }

        if (is_array($value)) {
            return array_map(static function ($type) {
                return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET;
            }, $types);
        }

        return $types;
    }
1219874
public function getPrimaryKey($table)
    {
        $query = $this->getUtilityQuery();
        $results = $this->getColumns($table, "`Key` = 'PRI'");
        return isset($results[0]['Field']) ? $results[0]['Field'] : null;
    }
475386
public function tableClass($table)
    {
        $tables = $this->getTableNames();
        $class = array_search($table, $tables, true);
        if ($class) {
            return $class;
        }

        // If there is no class for this table, strip table modifiers (e.g. _Live / _Versions)
        // from the end and re-attempt a search.
        if (preg_match('/^(?<class>.+)(_[^_]+)$/i', $table, $matches)) {
            $table = $matches['class'];
            $class = array_search($table, $tables, true);
            if ($class) {
                return $class;
            }
        }
        return null;
    }
111826
public function select($table = null, $fields = null)
    {
        return $this->table($table)->select($fields);
    }
178661
public function getAlterAdd($table, $field)
    {
        $table = $this->validTableName($table);
        $name = $field['field'];
        $type = $field['type'];
        if (isset($field['default']) && $field['default'] !== '') {
            $type .= " DEFAULT '" . $field['default'] . "'";
        }
        return 'ALTER TABLE ' . $table . ' ADD `' . $name . '` ' . $type;
    }