Skip to content

Commit

Permalink
Cleaned up constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonygauthier committed Apr 1, 2019
1 parent 30bcbf3 commit 50811c1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/MySimpleORM/Mapper/ObjectMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 50811c1

Please sign in to comment.