Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public function getConnection()
  2. {
  3. if (!$this->_connection) {
  4. $this->_setConnection();
  5. }
  6. return $this->_connection;
  7. }
  8.  
  9. private function _setConnection()
  10. {
  11. if (!$this->_connection) {
  12. $this->_connection = Mage::getSingleton('core/resource')->createConnection(self::EXTERNAL_RESOURCE_NAME, 'pdo_mysql', $this->getConfig());
  13. }
  14. }
  15.  
  16. $dbConnection = $this->getConnection();
  17. $sql = $dbConnection->query("select...");
  18. $res = $sql->fetchAll();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement