public function getConnection(OutputInterface $output = null) { if (!$this->_connection) { $this->_connection = $this->getDbSettings($output)->getConnection(); } return $this->_connection; }
/** * @param string $sql * * @return array|bool */ protected function _query($sql) { /** @var \PDO $connection */ $connection = $this->dbHelper->getConnection($this->output); $query = $connection->prepare($sql); $query->execute(); $result = $query->fetch(\PDO::FETCH_ASSOC); return $result; }