@param mixed[] $columnSql

@return bool
540679
protected function onSchemaAlterTableAddColumn(Column $column, TableDiff $diff, &$columnSql)
    {
        if ($this->_eventManager === null) {
            return false;
        }

        if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableAddColumn)) {
            return false;
        }

        $eventArgs = new SchemaAlterTableAddColumnEventArgs($column, $diff, $this);
        $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableAddColumn, $eventArgs);

        $columnSql = array_merge($columnSql, $eventArgs->getSql());

        return $eventArgs->isDefaultPrevented();
    }
740564
public function addSelect($columns) {
		if(is_array($columns))
			return $this->_addSelect($columns);

		$columns = explode(',', $columns);
		foreach($columns as $columnstr) {
			$columnstr = trim($columnstr);

			preg_match('/(.*?)\s+as\s+([a-z_][a-zA-Z0-9_]*)?$/i', $columnstr, $matches);
			if(isset($matches[2])) {
				$alias = $matches[2];
				$column = $matches[1];
			}
			else
				$alias = $column = $columnstr;

			if(isset($this->columns[$alias]))
				throw new \Exception('Column alias '.$alias.' is already used.');
			$this->columns[$alias] = $column;
		}

		return $this;
	}
11238
public function hasColumn($column, $caseInsensitive = false)
    {
        if ($column instanceof Column) {
            $column = $column->getName();
        }

        if ($caseInsensitive) {
            return isset($this->columnsByLowercaseName[strtolower($column)]);
        }

        return isset($this->columnsByName[$column]);
    }
158035
public function get($columns = ['*'])
    {
        if ($this->query->from instanceof Subquery) {
            $this->wheresToSubquery($this->query->from);
        }

        return parent::get($columns);
    }
251498
public function select($columns = "*") : QueryBuilder
    {
        $this->_query[] = "SELECT";

        //Parse column(s)
        if(is_array($columns)) {
            $select_columns = "";

            $size = sizeof($columns);
            for($i = 0; $i < $size; $i++) {
                if($i > 0) {
                    $select_columns .= ', ';
                }

                $select_columns .= '`'. $this->sanitize((string)$columns[$i]) .'`';
            }

            $this->_query[] = $select_columns;

            return $this;
        }

        $select_columns = "*";
        if(
            !empty($columns) &&
            $columns !== "*"
        ) {
            $select_columns = '`'. $this->sanitize((string)$columns) .'`';
        }

        $this->_query[] = $select_columns;

        return $this;
    }
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;
    }
489023
public function selectConcat(array $columns, string $delimiter = '', ?string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->columnConcat($columns, $delimiter, $alias);

        return $instance;
    }
1141130
public function queryColumn($sql = null,$params = array())
	{
		if(!isset($this->operationOption['params']))
		{
			$this->operationOption['params'] = array();
		}
		$this->prepareQuery($sql ? $sql : $this->buildSelectSQL(),$params);
		if(false === $this->lastStmt)
		{
			return false;
		}
		else
		{
			return $this->lastStmt->fetchAll(PDO::FETCH_COLUMN);
		}
	}
354762
public function hasColumn($col)
    {
        if (!$this->getModel()->getOwnColumns()) return true;
        if (in_array($col, $this->getModel()->getOwnColumns())) return true;
        if (in_array($col, $this->getModel()->getExprColumns())) return true;
        foreach ($this->_getSiblingRows() as $r) {
            if ($r->hasColumn($col)) return true;
        }
        return false;
    }
804755
public function hasColumn ($table, $column)
		{
			$schema = $this->db->getTableSchema($table);

			return isset($schema->columns[ $column ]);
		}
1030130
public function hasSameColumnNames(array $columnNames)
    {
        if (count($columnNames) !== count($this->getColumnNames())) {
            return false;
        }

        foreach ($columnNames as $i => $columnName) {
            if (!isset($this->columnNames[$i]) || ($columnName !== $this->columnNames[$i])) {
                return false;
            }
        }

        return true;
    }
511456
protected function _get($columns = '*')
    {
        $data = $this->db->select($this->table, $columns, $this->where);

        if (empty($data)) {
            return false;
        }

        return $this->getModelObjects($data);
    }
414791
protected function select($columns=[])
    {
        $query = $this->model->newQuery()->getQuery();
        if ($columns) {
            $query->select($columns);
        }
        return $query;
    }
243162
public function indexExists( $table, $columns = [ ] )
    {
        if ( !is_array( $columns ) )
        {
            throw new Exception( 'columns must be an array' );
        }

        $query = "SELECT * FROM information_schema.statistics WHERE table_schema =
                 ? AND table_name = ? AND ";

        $params = [ $this->name, $table ];

        foreach ( $columns as $column )
        {
            $query .= "column_name = ? OR ";
            $params[ ] = &$column;
        }

        $query = rtrim( $query, ' OR ' );

        $statement = $this->database->prepare( $query );
        $statement->execute( $params );

        $result = $statement->fetchAll();

        return !empty( $result );
    }
978418
protected function verifyColumns(array $columns, array $values): bool {
		
		// to verify our columns, we need to be sure that our array of $values to
		// insert both (a) contains the same number of columns, (b) is always
		// the same list of columns.  for (b) this means that one row can't insert
		// and ID and email address while another row tries to insert an ID and
		// phone number.
		
		// TODO: test to see if skipping $values[0] would save time.
		
		$columnCount = sizeof($columns);
		
		foreach ($values as $value) {
			
			// our first test is to see if the count of columns in our $value
			// matches the count we expect to find.  if not, we'll throw an
			// Exception to help the calling scope know what went wrong here.
			
			if (sizeof($value) !== $columnCount) {
				throw new DatabaseException("insertMultiple failed: mismatched column counts");
			}
			
			// if we're still testing columns, then we'll want to see that there's
			// no difference between the names of our $columns and the keys of this
			// specific $value.
			
			$theseColumns = array_keys($value);
			$difference = array_diff($columns, $theseColumns);
			if (sizeof($difference) !== 0) {
				throw new DatabaseException("insertMultiple failed: mismatched columns");
			}
		}
		
		// if we looped through the entire list of $values and didn't throw an Exception,
		// then we've verified that our columns will allow us to insert these multiple
		// rows.  so, we return true.
		
		return true;
	}
69170
public function where($column, $operator = '=', $value = null, $boolean = 'and', array $columns = ['*'])
    {
        return $this->repository->makeQuery()->where($column, $operator, $value, $boolean, $columns)->get($columns);
    }
190378
public static function field_exists($table, $columns, $db = null)
	{
		if ( ! is_array($columns))
		{
			$columns = array($columns);
		}

		try
		{
			\DB::select_array($columns)->from($table)->limit(1)->execute($db ? $db : static::$connection);
			return true;
		}
		catch (\Database_Exception $e)
		{
			// check if we have a DB connection at all
			$connection = \Database_Connection::instance($db ? $db : static::$connection)->has_connection();

			// if no connection could be made, re throw the exception
			if ( ! $connection)
			{
				throw $e;
			}

			return false;
		}
	}