public function __construct($tableName = null, $id = 'id', $server = array()) { $this->tblName = $tableName == null ? lcfirst(substr(get_called_class(), 0, -3)) : $tableName; $this->dbh = CxPdo::getInstance($server); $this->id = $id; $this->tbl = new CxTable($this->dbh, $this->tblName); }