diff options
Diffstat (limited to 'class/CommonTable.php')
| -rw-r--r-- | class/CommonTable.php | 5 | 
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; | 
