Revision: 11965
http://sourceforge.net/p/xoops/svn/11965
Author: rgriffith
Date: 2013-08-22 23:04:58 +0000 (Thu, 22 Aug 2013)
Log Message:
-----------
Add Prefix and PSR cleanup
Modified Paths:
--------------
XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/connection.php
Modified: XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/connection.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/connection.php 2013-08-22 21:42:30 UTC (rev 11964)
+++ XoopsCore/branches/2.6.x/2.6.0_doctrine/htdocs/class/database/connection.php 2013-08-22 23:04:58 UTC (rev 11965)
@@ -9,30 +9,39 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
-/**
- * MySQL access
- *
- * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package class
- * @subpackage database
- * @since 1.0.0
- * @author Kazumi Ono <on...@xo...>
- * @version $Id: mysqldatabase.php 10328 2012-12-07 00:56:07Z trabis $
- */
-
defined('XOOPS_ROOT_PATH') or die('Restricted access');
/**
- * connection to a mysql database
+ * Connection wrapper for Doctrine DBAL Connection
*
- * @abstract
- * @author Kazumi Ono <on...@xo...>
- * @copyright copyright (c) 2000-2003 XOOPS.org
- * @package class
- * @subpackage database
+ * @category Xoops\Database\XoopsConnection
+ * @package Xoops
+ * @author readheadedrod
+ * @author Richard Griffith <ri...@ge...>
+ * @copyright 2013 The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @version Release: 1.0
+ * @link http://xoops.org
+ * @since 1.0
*/
class XoopsConnection extends \Doctrine\DBAL\Connection
{
+ /**
+ * Prepend the prefix.'_' to the given tablename
+ * If tablename is empty, just return the prefix.
+ *
+ * @param string $tablename tablename
+ *
+ * @return string prefixed tablename, or prefix if tablename is empty
+ */
+ public function prefix($tablename = '')
+ {
+ if ($tablename != '') {
+ return XOOPS_DB_PREFIX . '_' . $tablename;
+ } else {
+ return XOOPS_DB_PREFIX;
+ }
+ }
+
}
\ No newline at end of file
|