public function tableOrSubQuery() { if ($this->_query->table instanceof Query) { return '(' . DialectFactory::create()->buildQuery($this->_query->table) . ')'; } return $this->_query->table; }