determine is column exists in database.base

@param string $column
@param $key
@param $datas
@param $rule
168536
protected function runColumnExists($column, $key, $datas, $rule)
    {
        $advanced = Database::table($datas[$key])->columnExists($column);

        if (!$advanced->isSuccess()) {
            $this->fails[] = $messageKey = "$rule.$key";

            $this->addMessage($key, $rule, $messageKey);
        }
    }
694650
public function hasForeignKey($columns, $constraint = null)
    {
        return $this->getAdapter()->hasForeignKey($this->getName(), $columns, $constraint);
    }
291265
public function addWhereIn(string $column, array $values)
    {
        foreach ($values as $value) {  // pour bindValue(s)
            $this->wheresIn[][2] = $value;
        }

        $this->sql['where'] .= " ".$this->logicOperator." ".$column." IN ".$this->addConditionsToSqlWhithWhereIn()." ";

        $this->logicOperator = " AND ";
    }
1132382
public static function has($data, $key)
    {
        if (self::isArrayAccess($data)) {
            return array_key_exists($key, $data);
        }
        if (!is_object($data)) {
            return false;
        }
        if (method_exists($data, 'get' . $key)) {
            return true;
        }
        if (method_exists($data, 'get' . str_replace('_', '', $key))) {
            return true;
        }
        if (isset($data->$key)) {
            return true;
        }

        return false;
    }
802776
protected function checkFilterColumn($column): bool
    {
        return array_key_exists($column, $this->getAllowFilters()) ||
            \in_array($column, $this->getAllowFilters(), false);
    }
1205323
protected function addColumn($key, $field, $column)
    {
        if ($this->hasCustomAttribute($column)) {
            return '->' . $field;
        }
        if ($key == 0) {
            return '->' . $field . "('" . $column . "')";
        }
        if (str_contains($field, '(')) {
            return '->' . $field;
        }

        return '->' . $field . '()';
    }
279692
protected function regexColumnSearch($column, $keyword, $caseSensitive = true)
    {
        if ($this->isOracleSql()) {
            $sql = $caseSensitive ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )';
            $this->query->whereRaw($sql, [$keyword]);
        } else {
            $sql = $caseSensitive ? $column . ' like ?' : 'LOWER(' . $column . ') like ?';
            $this->query->whereRaw($sql, [Str::lower($keyword)]);
        }
    }
554514
protected function resolveOrder($column, $key)
    {
        $this->resolve($column, $key, $this->getTableName(), function ($query, $pattern) {
            $this->builder->orderBy($query, $pattern);
        });
    }
903118
private function handleRule($rule, $key, array $allDatas)
    {

        $methodName = "run";

        if (!strstr($rule, "_")) {
            $methodName .= ucfirst($rule);
        } else {
            $parsedName = array_map(function ($value) {
                return ucfirst($value);
            }, explode("_", $rule));

            $methodName = $methodName . join("", $parsedName);
        }

        if (!strstr($rule, ":")) {
            $called = $this->callMethod($methodName, [$key, $allDatas, $rule]);
        } else {
            $value = explode(":", $key)[1];
            if (strstr($value, ",")) {
                $sendDatas = [explode(",", $value), $key, $allDatas, $rule];
            } else {
                $sendDatas = [$value, $key, $allDatas, $rule];
            }

            $called = $this->callMethod($methodName, $sendDatas);
        }

        return $called;

    }
874951
public static function hasColumn($column)
    {
        $cls  = get_called_class();
        $key  = null;
        $keys = self::$_columns[$cls];

        foreach ($keys as $ckey) {
            $col1 = self::isIgnoringCase() ? strtolower($ckey)   : $ckey;
            $col2 = self::isIgnoringCase() ? strtolower($column) : $column;
            if ($col1==$col2) {
                $key = $ckey;
                break;
            }
        }
        return $key;
    }
545295
public static function joinCondition($data, $column, $in = true)
    {
        $join = is_array($data) ? (join(',', $data) ?: -1) : ($data ?: -1);
        $kw = $in ? "IN" : "NOT IN";
        return "$column $kw(" . $join . ")";
    }
722257
protected function parseSchema($data, $key)
    {
        $this->parseDefined($key);

        if (array_key_exists(self::REQUIRED_KEY, $data)) {
            $this->parseRequired(
                $key,
                $data[self::REQUIRED_KEY]
            );
        }

        if (array_key_exists(self::DEFAULT_VALUE, $data)) {
            $this->parseDefault(
                $key,
                $data[self::DEFAULT_VALUE]
            );
        }
    }
205780
protected function checkDataSet(array $data, $key, $isNew)
    {
        $keyExists = array_key_exists($key, $data);

        if (($isNew && !($keyExists && $data[$key] !== null)) || (!$keyExists || $data[$key] === null)) {
            throw new \Exception(sprintf("Missing attribute %s", $key));
        }

        return $keyExists;
    }
948642
public function addFilterSelect($key, $name, array $options, $column = null)
	{
		$column = $column ?: $key;

		if (!is_string($column)) {
			throw new DataGridException('Filter Select can only filter in one column.');
		}

		$this->addFilterCheck($key);

		return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column);
	}
220969
private function checkDataIsUnreliable($data, $key)
    {
        return isset($data[$key]) && ($data[$key] !== $this->visitorInfo[$key]);
    }
972765
protected function checkKeyExists($data, $key)
    {
        if (!$data->has($key)) {
            $this->output->writeln("<error>The key $key does not exist.");

            return false;
        }

        return true;
    }
703576
protected function _validateDataKey($key, $data)
    {
        $dataOkFlag = true;

        if (!$this->_validationOn) {
            return $dataOkFlag;
        }

        foreach ($this->_validationRules as $ruleKey => $ruleValue) {
            if (!preg_match($ruleKey, $key)) {
                continue;
            }

            $bool = $this->_validateData($ruleValue, $key, $data);
            if (!$bool) {
                $dataOkFlag = false;
            }
        }

        return $dataOkFlag;
    }