select = $select; $this->connectionName = $connectionName; $this->selectHydrator = $selectHydrator; $this->config = $config; } /** * @return Select */ public function getSelect() { return $this->select; } /** * @return string */ public function getConnectionName() { return $this->connectionName; } /** * @return array */ public function getConfig() { return $this->config; } /** * Specify data which should be serialized to JSON * @link http://php.net/manual/en/jsonserializable.jsonserialize.php * @return mixed data which can be serialized by json_encode, * which is a value of any type other than a resource. */ public function jsonSerialize() { return [ 'connectionName' => $this->getConnectionName(), 'select_parts' => $this->selectHydrator->extract($this->getSelect()), 'config' => $this->getConfig() ]; } }