Private/Polyfony/Query.php
public function select(array $array=[]) {
		// set the main action
		$this->action('SELECT');
		// for each column
		foreach($array as $function_or_index_or_column => $column) {
			// secure the column name
			list($column, $placeholder) = Query\Convert::columnToPlaceholder($this->Quote ,$column, true);
			// if the key is function_or_index_or_column
			if(is_numeric($function_or_index_or_column)) {
				// just select the column
				$this->Selects[] = $column;
			}
			// the key contains a dot, we are trying to create a alias
			elseif(stripos($function_or_index_or_column, '.') !== false) {
				// secure the column
				list($column) = Query\Convert::columnToPlaceholder($this->Quote ,$function_or_index_or_column);
				// select the column and create an alias
				$this->Selects[] = "{$column} AS {$placeholder}";
			}
			// the key is a SQL function
			else {
				// secure the function
				list($function) = Query\Convert::columnToPlaceholder($this->Quote ,$function_or_index_or_column);
				// select the column using a function
				$this->Selects[] = "{$function}({$column}) AS {$function}_{$placeholder}";
			}
		}
		// return self to the next method
		return $this;
	}
public function select(array $array=[]) {
		// set the main action
		$this->action('SELECT');
		// for each column
		foreach($array as $function_or_index_or_column => $column) {
			// secure the column name
			list($column, $placeholder) = Query\Convert::columnToPlaceholder($this->Quote ,$column, true);
			// if the key is function_or_index_or_column
			if(is_numeric($function_or_index_or_column)) {
				// just select the column
				$this->Selects[] = $column;
			}
			// the key contains a dot, we are trying to create a alias
			elseif(stripos($function_or_index_or_column, '.') !== false) {
				// secure the column
				list($column) = Query\Convert::columnToPlaceholder($this->Quote ,$function_or_index_or_column);
				// select the column and create an alias
				$this->Selects[] = "{$column} AS {$placeholder}";
			}
			// the key is a SQL function
			else {
				// secure the function
				list($function) = Query\Convert::columnToPlaceholder($this->Quote ,$function_or_index_or_column);
				// select the column using a function
				$this->Selects[] = "{$function}({$column}) AS {$function}_{$placeholder}";
			}
		}
		// return self to the next method
		return $this;
	}
public function select ( array $ array = [ ] ) { // set the main action $ this -> action ( 'SELECT' ) ; // for each column foreach ( $ array as $ function_or_index_or_column => $ column ) { // secure the column name list ( $ column , $ placeholder ) = Query \ Convert :: columnToPlaceholder ( $ this -> Quote , $ column , true ) ; // if the key is function_or_index_or_column if ( is_numeric ( $ function_or_index_or_column ) ) { // just select the column $ this -> Selects [ ] = $ column ; } // the key contains a dot, we are trying to create a alias elseif ( stripos ( $ function_or_index_or_column , '.' ) !== false ) { // secure the column list ( $ column ) = Query \ Convert :: columnToPlaceholder ( $ this -> Quote , $ function_or_index_or_column ) ; // select the column and create an alias $ this -> Selects [ ] = "{$column} AS {$placeholder}" ; } // the key is a SQL function else { // secure the function list ( $ function ) = Query \ Convert :: columnToPlaceholder ( $ this -> Quote , $ function_or_index_or_column ) ; // select the column using a function $ this -> Selects [ ] = "{$function}({$column}) AS {$function}_{$placeholder}" ; } } // return self to the next method return $ this ; }
first main method
first main method