diff --git a/dblayeroo.php b/dblayeroo.php index 11fd341..5640a43 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -57,6 +57,19 @@ class dblayeroo */ public function __construct ($dsn, $username=null, $password=null, $driver_options=null) + { + $this->connect ($dsn, $username, $password, $driver_options); + } + + /** Connection to the database engine + * See http://fr2.php.net/manual/en/pdo.construct.php for the $dsn format + * @param string $dsn PDO Data Source Name + * @param string|null $username Username to connect + * @param string|null $password Password to connect + * @param string|null $driver_options Driver options to the database + */ + public function connect ($dsn, $username=null, $password=null, + $driver_options=null) /* {{{ */ { $driver = @explode (":", $dsn); @@ -1306,7 +1319,7 @@ class dblayeroo $this->debugLog ("Entering setForeignObj (OBJECT)"); if (! is_object ($object)) $this->DBException ("Invalid setForeignObj parameter: not an object"); - if (get_class ($object) !== __CLASS__) + if (! is_subclass_of ($object, __CLASS__)) $this->DBException ( "Invalid object provided to setForeignObj (not dblayeroo object)"); if (! isset ($object->table))