Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UnionRenderer.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
22  public function render(Select $select, $sql = '')
23  {
24  if ($select->getPart(Select::UNION)) {
25  $sql = '';
26  $parts = count($select->getPart(Select::UNION));
27  foreach ($select->getPart(Select::UNION) as $cnt => $union) {
28  list($target, $type) = $union;
29  if ($target instanceof Select) {
30  $target = $target->assemble();
31  }
32  $sql .= $target;
33  if ($cnt < $parts - 1) {
34  $sql .= ' ' . $type . ' ';
35  }
36  }
37  }
38  return $sql;
39  }
40 }
$target
Definition: skip.phtml:8
$type
Definition: item.phtml:13
const UNION
Definition: Select.php:50