SELECT statement
example:
select('contact.*, user.email)
select(array('contact.*', 'user.email'))

@param string|array $fields
@return \Ark\Database\QueryBuilder
504848
public function select($fields = '*')
    {
        if (is_string($fields) && strpos($fields, '(') !== false) {
            $this->query['select'] = $fields;
        } else {
            if (!is_array($fields)) {
                $fields = $this->splitParts($fields);
            }
            foreach ($fields as $k => $field) {
                if (false === strpos($field, '(')) {
                    if ($alias = $this->matchAlias($field)) {
                        $fields[$k] = $this->db->quoteColumn($alias[0]) . ' AS ' . $this->db->quoteColumn($alias[1]);
                    } else {
                        $fields[$k] = $this->db->quoteColumn($field);
                    }
                }
            }
            $this->query['select'] = implode(', ', $fields);
        }

        return $this;
    }
833965
protected function select(array $field)
    {
        $output = '';

        // Tag around select element: same as for an input element.
        $output .= $this->getWrapper('input');

        // Select tag.
        $attributes = $field['attributes'];
        $attributes = $this->addAttribute($attributes, 'id', $field['id']);
        $attributes = $this->addAttribute($attributes, 'name', $field['name']);
        $output .= $this->getOpenTag('select', $attributes);

        // Options.
        foreach ($field['options'] as $value => $text) {
            $optionAttributes = array('value' => $value);
            if ($this->isOptionSelected($field['value'], $value)) {
                $optionAttributes['selected'] = true;
            }
            $output .= $this->getOpenTag('option', $optionAttributes);
            $output .= htmlspecialchars($text, $this->htmlSpecialCharsFlag, 'UTF-8');
            $output .= $this->getCloseTag('option');
        }

        // End tag.
        $output .= $this->getCloseTag('select');
        // Tag around select element.
        $output .= $this->getWrapperEnd('input');

        return $output;
    }
1156438
public function fields(array $fields, string $alias = null): Select
    {
        $alias = ($alias === null) ? '' : "{$alias}.";

        foreach ($fields as $field => $as) {
            if (is_numeric($field)) {
                $this->field($alias . $as);
            } else {
                $this->field($alias . $field, $as);
            }
        }

        return $this;
    }
1188232
public function select($fields)
    {
        if (!is_array($fields)) {
            $fields = func_get_args();
        }

        $fields = $this->addTablePrefix($fields);
        $this->addStatement('selects', $fields);
        return $this;
    }
861734
public function select($tableName, $fields = ['*'])
    {
        $sql = new Select($tableName, $fields);
        $sql->setAdapter($this->_adapter);
        return $sql;
    }
1230166
public function select(Array $fields = null)
    {
        $this->_fields = empty($fields) ? '*' : implode(',', $fields);
        return $this;
    }
1332270
public function update(array $fields = []) {
        $query = new UpdateQuery($this->getTable());
        $query->fields(!empty($fields)? $fields : $this->getFields());
        $query->whereConditionGroup($this->getWhereConditionGroup());
        return $this->connection->exec($query);
    }
1062513
public function select(...$select): Query\Select
    {
        $query = new Query\Select();
        $query->select(...$select);
        return $query;
    }
412704
public function get(array $field = []) {
        $join = $this->build()->parseJoin();
        if (!empty($field)) {
            $this->field($field);
        }
        return $this->connection->query($this->build()->select(), $this->build()->getSelectParams());
    }
1054711
public function getSelectQueryBuilder(array $fields = array())
    {
        $connection = $this->getConnection();
        $qb         = $connection->createQueryBuilder();
        $fields     = array_merge($this->getFields(), $fields);
        $fields     = array_merge(array($this->getUniqueId()), $fields);

        foreach ($fields as &$field) {
            if (is_array($field)) {
                $keyName    = current(array_keys($field));
                $expression = current(array_values($field));
                $field      = "$expression AS " . $this->connection->quoteIdentifier($keyName);
            }
        }

        $queryBuilder = $qb->select($fields)->from($this->getTableName(), 't');
        return $queryBuilder;
    }
710586
public function selectFields($fields)
    {
        # By default just select an empty string
        $select = "''";

        # If an array of fields have been passed
        if (is_array($fields)) {

            # If we have some fields, then add them to the query, ensuring they are quoted appropriately
            if (count($fields) > 0) {
                $select = "";

                foreach ($fields as $field) {
                    if ($select) {
                        $select .= ", ";
                    }
                    $select .= $this->quoteField($field);
                }
            }

        # if the fields isn't an array
        } elseif (!is_bool($fields)) {
            # Otherwise assume it is a string of fields to select and add them to the query
            if (strlen($fields) > 0) {
                $select = $fields;
            }
        }

        return $select;
    }
267231
function select($fields,$filter=NULL,array $options=NULL,$ttl=0) {
		list($sql,$args)=$this->stringify($fields,$filter,$options);
		$result=$this->db->exec($sql,$args,$ttl);
		$out=[];
		foreach ($result as &$row) {
			foreach ($row as $field=>&$val) {
				if (array_key_exists($field,$this->fields)) {
					if (!is_null($val) || !$this->fields[$field]['nullable'])
						$val=$this->db->value(
							$this->fields[$field]['pdo_type'],$val);
				}
				unset($val);
			}
			$out[]=$this->factory($row);
			unset($row);
		}
		return $out;
	}
1208000
public static function select(
        $table, $fields = array(),
        $condition = null,
        $statement = null)
    {
        $query = array('SELECT ');
        array_push($query, (empty($fields)?'*':implode(', ', $fields)));
        array_push($query, " FROM $table");
        array_push($query, (isset($condition))?" WHERE $condition":'');
        array_push($query, (isset($statement))?" $statement":'');
        return implode($query);
    }
1356214
public static function select( $table, $fields = array(), $handler = null ) 
	{
		return Query::select( $table, $fields, $handler );
	}
340108
public function select($fields=null)
    {
        if (func_num_args() > 1) {
            $fields = func_get_args();
        }
        $this->getQuery()->type('select')->fields($fields);
        return $this;
    }
1328816
public function setFields(array $fields)
    {
        foreach ($fields as $name => $value) {
            $this->setField($name, $value);
        }

        $this->prepareQuery();

        return $this;
    }
1058694
public function addSelect($fields, $bind = [])
    {
        if (!is_array($fields)) {
            $fields = [$fields];
        }

        foreach ($fields as $key => $field) {
            if ($field instanceof Entity) {
                $query = $field->getQuery();
                $this->bind($query->buildBinds(), 'select');
                if (is_numeric($key)) {
                    $this->select[] = '(' . $query->buildSQL() . ')';
                } else {
                    $this->select[$key] = '(' . $query->buildSQL() . ')';
                }
            } elseif ($field instanceof Raw) {
                $this->bind($field->buildBinds(), 'select');
                if (is_numeric($key)) {
                    $this->select[] = $field->buildSQL();
                } else {
                    $this->select[$key] = $field->buildSQL();
                }
            } elseif (is_numeric($key)) {
                $this->select[] = $field;
            } else {
                $this->select[$key] = $field;
            }
        }

        if ($bind) {
            $this->bind($bind, 'select');
        }

        return $this;
    }