Set from table and select fields
@param mixed $table
@param array $selectFields
@return \Puja\SqlBuilder\Builder
345386
public function from($table, $selectFields = array('*'))
    {
    	list($tableName, $tableAlias) = $this->tableProcess($table);
        $this->fromTable[$tableAlias] = $tableName;
        if (empty($selectFields)) {
            return $this;
        }
        if ($this->queryType == self::QUERYTYPE_SELECT) {
            $this->fields[$tableAlias] = $this->fieldProcess($tableAlias, $selectFields);
        } else {
            $this->fields[$tableAlias] = $selectFields;
        }
        return $this;
    }
1095919
public function select(array $fields)
    {
        if (empty($fields)) {
            throw new InvalidArgumentException('The field array must not be' .
                ' empty.');
        }

        foreach ($fields as $field) {
            $validationResult = QueryValidator::validateFieldName($field);
            if ($validationResult->isFailed()) {
                throw new InvalidArgumentException('The field array for' .
                    ' building the SELECT clause contains invalid field name.' .
                    ' Validation fail reason: ' .
                    $validationResult->getFailReason());
            }
        }

        // Flipping an array will create a new associative array. The keys of
        // the new associative array make a set of distinct fields.
        $distinctFields = array_flip($fields);
        $this->selectFields = array_keys($distinctFields);
    }
1159950
public function select($fields)
    {
        foreach ($fields as $key => $value) {
            if (is_int($key)) {
                $this->associationQueryFields($value);
            } elseif (is_array($value)) {
                $alias = $this->tableAlias();
                $this->queryBuilder->join($this->getFullFieldName($key, self::DEFAULT_TABLE_ALIAS), $alias);
                foreach ($value as $valueField) {
                    $this->queryFields[] = $this->getFullFieldName($valueField, $alias);
                }
            } else {
                $this->queryFields[] = $value;
            }
        }
        $this->queryBuilder->select(implode(',', $this->queryFields));

        return $this;
    }
75901
public function from($tables): SelectStatement
    {
        $subquery = new Subquery();
        $this->addExpression('subquery', $subquery);
        return $subquery->from($tables);
    }
1241029
public void setSelectFields(java.util.Collection<FieldInfo> selectFields) {
        if (selectFields == null) {
            this.selectFields = null;
            return;
        }

        this.selectFields = new com.amazonaws.internal.SdkInternalList<FieldInfo>(selectFields);
    }
632798
public function setFields( $fields )
	{
		if( is_array( $fields ) && count( $fields ) )
			$this->fields = $fields;
		else
			trigger_error( 'Field Array of Table Definition must no be empty.', E_USER_ERROR );
	}
972595
public function fieldSelectAll($table, $fields, $where, $orderBy = null)
    {
        $table = $this->getTableName($table);

        $query = "SELECT ";

        $query .= $this->selectFields($fields);

        $query .= " FROM " . $table . " ";

        $params = null;
        if ($where !== self::NO_WHERE_CLAUSE) {
            $query .= "WHERE " . $this->where($where, $params);
        }

        if ($orderBy) {
            $query .= $this->orderBy($orderBy) . " ";
        }

        return $this->query($query, $params);
    }
1061003
public function replace($table, array $updateFields)
    {
        $this->queryTypeProcess(self::QUERYTYPE_REPLACE, $table, $updateFields);
        //$this->fields = $updateFields;
        return $this;
    }
80353
public function addSimpleSelectFields(array $fields, $table = false): self
    {
        if (!$table) {
            $table = $this->getDbTableName();
        }

        foreach ($fields as $k => $field) {
            // Translation field
            if (\in_array($field, $this->getTranslationFields(), true)) {
                ++$this->translation_join_count;
                $this->addJoinTable(['cms_translations', $this->getTranslationTableJoinAlias() . $this->translation_join_count], 'id', $field, 'LEFT', $table);

                $this->sql_select_fields[] = [
                    'table' => $this->getTranslationTableJoinAlias() . $this->translation_join_count . '',
                    'field' => $this->getLanguage(),
                    'as'    => $field,
                    'type'  => TableStructure::FIELD_TYPE_TRANSLATION
                ];
            } else {
                // Simple field
                $this->sql_select_fields[] = [
                    'table' => $table,
                    'field' => $field,
                    'as'    => false,
                    'type'  => 'simple'
                ];
            }
        }

        return $this;
    }
565243
private function insert($table, array $fields)
    {
        return Yii::$app->db->createCommand()->insert($table, $fields)->execute();
    }
383329
public function getFields($table)
	{
		if (isset($this->tables[$table])) {
			return new Collection($this->tables[$table]);
		}
	}
591113
public function buildSelectFields($fields)
    {
        $selectFields = [];
        foreach ((array)$fields as $key => $value) {
            if (is_int($key)) {
                $selectFields[$value] = true;
            } else {
                $selectFields[$key] = is_scalar($value) ? (bool)$value : $value;
            }
        }
        return $selectFields;
    }
357808
public function from(string $table, string $alias = null, $field = null): Select
    {
        $this->from[] = [
          'table' => $table,
          'alias' => $alias
        ];

        if ($field !== null) {
            if (is_array($field)) {
                foreach ($field as $fld) {
                    $this->field(($alias ?? $table) . '.' . $fld);
                }
            } else {
                $this->field(($alias ?? $table) . '.' . $field);
            }
        }

        return $this;
    }
595188
public function setTable($table) {

		if(false === is_string($table)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($table)), E_USER_ERROR);
		}

		$this -> table = $table;

		return $this;
	}
1356214
public static function select( $table, $fields = array(), $handler = null ) 
	{
		return Query::select( $table, $fields, $handler );
	}
685996
public function select(
        $table,
        $conditions = null,
        $fields = null,
        $order = null,
        $limit = null,
        $offset = null
    )
    {
        if (is_null($fields)) {
            $fields = "*";
        }

        $queryString = "SELECT {$fields} FROM {$table} ";

        if (!is_null($conditions)) {
            $queryString .= "WHERE {$conditions} ";
        }

        if (!is_null($order)) {
            $queryString .= "ORDER BY {$order} ";
        }

        if (!is_null($limit)) {
            $queryString .= "LIMIT {$limit} ";
        }

        if (!is_null($offset) && !is_null($limit)) {
            $queryString .= "OFFSET {$offset} ";
        }


        $queryString .= ";";

        $this->query($queryString);

        return $this->countRows();
    }
843680
public function select($fields) {
        if (is_array($fields)) {
            $this->_fields = implode($fields, ', ');
        } else {
            $this->_fields = $fields;
        }
        
        // Build Select Command
        $sql_query = 'SELECT ' . $this->_distinct . $this->_fields .
                     ' FROM ' . $this->_table;

        if (count($this->_joins)) {
            $sql_query .= implode($this->_joins, ' ');
        }
        
        // Where statements
        if (count($this->_where)) {
            $sql_query .= ' WHERE ';
            $sql_query .= implode($this->_where, ' AND ');
            
            // or statements
            if (count($this->_or)) {
                $sql_query .= ' OR ';
                $sql_query .= implode($this->_or, ' AND ');
            }
        }
        
        // Alias
        if ($this->_alias) {
            $sql_query .= ' AS ' . $this->_alias;
        }
        
        // Union
        if (count($this->_union)) {
            $sql_query .= ' UNION ' . implode($this->_union, ' UNION ');
        }
        
        // Union All
        if (count($this->_union_all)) {
            $sql_query .= ' UNION ALL ' . implode($this->_union_all, ' UNION ALL ');
        }
        
        // Group By
        if (strlen($this->_group_by)) {
            $sql_query .= $this->_group_by;
        }
        
        // Order By
        if (strlen($this->_order)) {
            $sql_query .= $this->_order;
        }
        
        // Limit
        if (strlen($this->_limit)) {
            $sql_query .= $this->_limit;
        }
        
        // Set the query
        $this->_sql_query = $sql_query;
        
        return $this;
    }