Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Query.php
Go to the documentation of this file.
1 <?php
7 
9 
13 class Query implements \JsonSerializable
14 {
18  private $select;
19 
23  private $selectHydrator;
24 
28  private $connectionName;
29 
33  private $config;
34 
43  public function __construct(
44  Select $select,
45  SelectHydrator $selectHydrator,
46  $connectionName,
47  $config
48  ) {
49  $this->select = $select;
50  $this->connectionName = $connectionName;
51  $this->selectHydrator = $selectHydrator;
52  $this->config = $config;
53  }
54 
58  public function getSelect()
59  {
60  return $this->select;
61  }
62 
66  public function getConnectionName()
67  {
68  return $this->connectionName;
69  }
70 
74  public function getConfig()
75  {
76  return $this->config;
77  }
78 
85  public function jsonSerialize()
86  {
87  return [
88  'connectionName' => $this->getConnectionName(),
89  'select_parts' => $this->selectHydrator->extract($this->getSelect()),
90  'config' => $this->getConfig()
91  ];
92  }
93 }
__construct(Select $select, SelectHydrator $selectHydrator, $connectionName, $config)
Definition: Query.php:43