From 50811c1705c2fa8b76235c70695836e8f9a92741 Mon Sep 17 00:00:00 2001 From: Anthony Gauthier Date: Mon, 1 Apr 2019 13:23:21 -0400 Subject: [PATCH] Cleaned up constructor --- src/MySimpleORM/Mapper/ObjectMapping.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/MySimpleORM/Mapper/ObjectMapping.php b/src/MySimpleORM/Mapper/ObjectMapping.php index e65bf1a..1cc8e45 100644 --- a/src/MySimpleORM/Mapper/ObjectMapping.php +++ b/src/MySimpleORM/Mapper/ObjectMapping.php @@ -30,10 +30,8 @@ public function __construct($o) $this->ClassName = $classPathArray[sizeof($classPathArray) - 1]; $this->Database = new Database(); $this->Object = $o; - if ($this->Database->connect()) { - $this->PrimaryKey = $this->Database->getKeys($this->ClassName, "primary"); - $this->ForeignKeys = $this->Database->getKeys($this->ClassName, "foreign"); - } + $this->PrimaryKey = $this->Database->getKeys($this->ClassName, "primary"); + $this->ForeignKeys = $this->Database->getKeys($this->ClassName, "foreign"); } public function __destruct()