Connects to the database without initializing magento
public getConnection ( Symfony\Component\Console\Output\OutputInterface $output = null ) : PDO | ||
$output | Symfony\Component\Console\Output\OutputInterface | = null |
Результат | PDO |
/** * @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; }