Query::select()

@return
482384
public function select($fields)
    {
        if (is_string($fields))
            $fields = explode(',',trim($fields));
        if (is_array($fields))
            $this->fields = $fields;
        return $this;
    }
520483
public function makeQuery()
    {
        $query = $this->query()->select($this->makeSelect($this->columns()));

        return $query;
    }
752590
public function GetSelect() {
      // Close off any open query elements.
      $this->_EndQuery();
      
      $Sql = (!$this->_Distinct) ? 'select ' : 'select distinct ';

      // Don't escape the field if it is numeric or an asterisk (all columns)
      $Selects = array();
      foreach($this->_Selects as $Key => $Expr) {
         $Field = $Expr['Field'];
         $Function = $Expr['Function'];
         $Alias = $Expr['Alias'];
         $CaseOptions = ArrayValue('CaseOptions', $Expr);
         if ($Field != '*' && !is_numeric($Field))
            $Field = $this->EscapeIdentifier($Field);

         if ($Alias == '' && $Function != '')
            $Alias = $Field;

         // if (in_array(strtolower($Function), array('max', 'min', 'avg', 'sum', 'count')))
         if ($Function != '') {
				if(strpos($Function, '%s') !== FALSE)
					$Field = sprintf($Function, $Field);
				else
					$Field = $Function.'('.$Field.')';
			}

         if ($CaseOptions !== FALSE)
            $Field = 'case ' . $Field . $CaseOptions . ' end';

         if ($Alias != '')
            $Field .= ' as '.$this->QuoteIdentifier($Alias);

         if ($Field != '')
            $Selects[] = $Field;
      }
      $Sql .= (count($Selects) == 0) ? '*' : implode(', ', $Selects);

      if (count($this->_Froms) > 0)
         $Sql .= "\nfrom ".$this->_FromTables($this->_Froms);

      if (count($this->_Joins) > 0) {
         $Sql .= "\n";
         $Sql .= implode("\n", $this->_Joins);
      }

      if (count($this->_Wheres) > 0)
         $Sql .= "\nwhere ";

      $Sql .= implode("\n", $this->_Wheres);

      // Close any where groups that were left open.
      for ($i = 0; $i < $this->_OpenWhereGroupCount; ++$i) {
         $Sql .= ')';
      }
      $this->_OpenWhereGroupCount = 0;

      if (count($this->_GroupBys) > 0) {
         $Sql .= "\ngroup by ";

         // special consideration for table aliases
         if (count($this->_AliasMap) > 0 && $this->Database->DatabasePrefix)
            $Sql .= implode(', ', $this->_FilterTableAliases($this->_GroupBys));
         else
            $Sql .= implode(', ', $this->_GroupBys);
      }

      if (count($this->_Havings) > 0)
         $Sql .= "\nhaving ".implode("\n", $this->_Havings);

      if (count($this->_OrderBys) > 0)
         $Sql .= "\norder by ".implode(', ', $this->_OrderBys);

      if (is_numeric($this->_Limit)) {
         $Sql .= "\n";
         $Sql = $this->GetLimit($Sql, $this->_Limit, $this->_Offset);
      }

      return $Sql;
   }
340108
public function select($fields=null)
    {
        if (func_num_args() > 1) {
            $fields = func_get_args();
        }
        $this->getQuery()->type('select')->fields($fields);
        return $this;
    }
1326628
public function select($column)
    {
        $builder         = new Select($this->driver);
        $this->lastQuery = $builder;

        $columns = is_array($column) ? $column : func_get_args();

        return $builder->select($columns);
    }
1258025
protected function getQueryResult()
    {
        if ($this->queryResult) {
            return $this->queryResult;
        }

        return $this->queryResult = $this->getSelector()
            ->getSelectBuilder()
            ->execute();
    }
884143
public function execute() : Query
    {
        $this->applyFilters();
        $this->applySelect();
        $this->applyJoins();

        $clause = $this->query->clause('where');
        // adjust where clause conjunction
        if (null !== $clause) {
            $this->query->where($clause->setConjunction($this->conjunction), [], true);
        }

        return $this->query;
    }
598407
public function selectWith(\Zend\Db\Sql\Select $select)
    {
        if ($this->usePaginator === true) {
            return $this->initPaginator($select);
        }

        $this->result = $this->tableGateway->selectWith($select);

        return $this->result;
    }
1178270
function Select($sql)
	{
		$this->RequireConnection(true);

		$this->handler->Log(DBH_LOG_QUERY, "Executing Query", $sql);
		
		return $this->adapter->Select($sql);
	}
1053501
public static function select()
    {
        $result = null;

        switch (static::getDriver()) {
            case self::DRIVER_MYSQL:
                $result = new \pwf\components\querybuilder\adapters\MySQL\SelectBuilder();
                break;
            case self::DRIVER_PG:
                $result = new \pwf\components\querybuilder\adapters\PostgreSQL\SelectBuilder();
                break;
            default:
                throw new \Exception('Wrong query builder driver');
        }

        return $result;
    }
974789
public function select($columns= '*') {
        if (!is_array($columns)) {
            $columns= trim($columns);
            if ($columns == '*' || $columns === $this->_alias . '.*' || $columns === $this->xpdo->escape($this->_alias) . '.*') {
                $columns= $this->xpdo->getSelectColumns($this->_class, $this->_alias, $this->_alias . '_');
            }
            $columns= explode(',', $columns);
            foreach ($columns as $colKey => $column) $columns[$colKey] = trim($column);
        }
        if (is_array ($columns)) {
            if (!is_array($this->query['columns'])) {
                $this->query['columns']= $columns;
            } else {
                $this->query['columns']= array_merge($this->query['columns'], $columns);
            }
        }
        return $this;
    }
793096
public function select($columns = "*")
    {
        $this->start = $columns;
        $this->queryType = self::QUERY_SELECT;
        return $this;
    }
565478
final public function select($select = "*") {
      $this->connection();
      if (func_num_args()>1)
         $select = func_get_args();
      else if(is_string($select)) {
         $select = [$select];
      }

      $select_tmp = [];
      foreach ($select as $value) {

         if ( $value===NULL )
            $select_tmp[] = ' NULL ';
         elseif ( gettype( $value )==='boolean' )
            $select_tmp[] = $value ? ' TRUE ' : ' FALSE ';
         elseif ($value instanceof \Closure) {
            $value(new \Daniia\Daniia());
            if (preg_match("/^CASE/", $_ENV['daniia_daniia']->case)) {
               $select_tmp[] = '( '.$_ENV['daniia_daniia']->case.' '.$_ENV['daniia_daniia']->when.' '.$_ENV['daniia_daniia']->else.' END )';
               $_ENV['daniia_daniia']->case = NULL;
            }
            else {
               $select_tmp[] = $_ENV['daniia_daniia']->get_sql();
               $_ENV['daniia_daniia'] = null;
            }
         }
         elseif ( in_array(strtolower(trim($value)), $this->columnsData, true) )
            $select_tmp[] = $value;
         else {
            $select_tmp[] = $value;
         }

      }

      $select = implode(",", $select_tmp);
      $this->select = str_replace("*", $select, $this->select);

      $this->find_first_data = $this->find_save_data = $this->find_delete_data = FALSE;

      $this->get_instance();
      return $this;
   }
414791
protected function select($columns=[])
    {
        $query = $this->model->newQuery()->getQuery();
        if ($columns) {
            $query->select($columns);
        }
        return $query;
    }
327750
public function query()
    {
        $params = func_get_args();
        $query = array_shift($params);

        // Support one argument of type array, instead of n arguments
        if (count($params) == 1 && is_array($params[0])) {
            $params = $params[0];
        }

        return $this->_query($query, 0, 0, $params);
    }
960872
private function selectQuery($sql, array $params = array())
    {
        $stmt = $this->getConnection()->prepare($sql);
        $stmt->execute($params);

        return $stmt->fetchAll(PDO::FETCH_ASSOC);
    }
1097567
public function getQuery() {
        $query = 'SELECT '.implode(', ', $this->fields)
                .' FROM '.implode(', ', $this->from);
        if (count($this->conditions) > 0) {
            $query = $query.' WHERE '.implode(' AND ', $this->conditions);
        }
        $query = rtrim($query).';';

        return $query;
    }