Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GroupRenderer.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  protected $quote;
20 
24  public function __construct(
26  ) {
27  $this->quote = $quote;
28  }
29 
37  public function render(Select $select, $sql = '')
38  {
39  if ($select->getPart(Select::FROM) && $select->getPart(Select::GROUP)) {
40  $group = [];
41  foreach ($select->getPart(Select::GROUP) as $term) {
42  $group[] = $this->quote->quoteIdentifier($term);
43  }
44  $sql .= ' ' . Select::SQL_GROUP_BY . ' ' . implode(",\n\t", $group);
45  }
46  return $sql;
47  }
48 }
const SQL_GROUP_BY
Definition: Select.php:73
$group
Definition: sections.phtml:16
const FROM
Definition: Select.php:49
const GROUP
Definition: Select.php:52