summaryrefslogtreecommitdiffstats
path: root/class/CommonTable.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2010-11-01 08:05:02 +0100
committerRemi Collet <fedora@famillecollet.com>2010-11-01 08:05:02 +0100
commit7ebd0320aeaa78a74c46c5f0a1e2b7b6cd9b6568 (patch)
tree514d814bf33ee2e914aac5937d7632e48534413f /class/CommonTable.php
parent243f517f1fa0548b27a33e8a429a780a4a587e88 (diff)
Improves CommonTable::__construct() : table name option is now optionnal
Diffstat (limited to 'class/CommonTable.php')
-rw-r--r--class/CommonTable.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/class/CommonTable.php b/class/CommonTable.php
index 7e1dd8e..ba3f7ad 100644
--- a/class/CommonTable.php
+++ b/class/CommonTable.php
@@ -43,8 +43,11 @@ abstract class CommonTable
* @param object $db PDO instance of the DB connection
* @param string $table with table name
*/
- function __construct(PDO $db, $table)
+ function __construct(PDO $db, $table='')
{
+ if (empty($table)) {
+ $table = substr(strtolower(get_class($this)),5);
+ }
$this->db = $db;
$this->table = $table;