Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
fastslack committed Sep 12, 2014
1 parent 8c405e8 commit 530a927
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion libraries/joomla/form/fields/sql.php
Expand Up @@ -136,10 +136,15 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
{
// Get the query from the form
$query = array();

$query['select'] = (string) $this->element['sql_select'];

$query['from'] = (string) $this->element['sql_from'];

$query['join'] = $this->element['sql_join'] ? (string) $this->element['sql_join'] : '';

$query['group'] = $this->element['sql_group'] ? (string) $this->element['sql_group'] : '';

$query['order'] = (string) $this->element['sql_order'];

// Get the filters
Expand All @@ -165,23 +170,28 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
*
* @return $query The query object.
*
* @since 12.1
* @since 3.4
*/
protected function processQuery($conditions, $filter)
{
// Get the database object.
$db = JFactory::getDbo();

// Get the query object
$query = $db->getQuery(true);

// Select fields
$query->select($conditions['select']);

// From selected table
$query->from($conditions['from']);

// Join over the groups
if (!empty($conditions['join']))
{
$query->join('LEFT', $conditions['join']);
}

// Group by
if (!empty($conditions['group']))
{
Expand Down

0 comments on commit 530a927

Please sign in to comment.