/** * Get db write connection * @return type */ public static function getDb() { if (is_null(self::$_db)) { self::$_db = Mage::getModel('core/resource')->getConnection('core_write'); } return self::$_db; }