Skip to content

Commit

Permalink
Override table id key in initProperties() if table fields id is given
Browse files Browse the repository at this point in the history
  • Loading branch information
arnemorken committed Nov 27, 2024
1 parent b775399 commit c256957
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/mysql/anyTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ private function initProperties($paramOrType)
//if ($paramOrType["path"]) $this->mPath = $paramOrType["path"];
}
//
// Override table id key if table fields id is given
//
if ($this->mTableFields && $this->mTableFields[0])
$this->mIdKeyTable = $this->mTableFields[0];
//
// Set defaults if not set yet
//
if (!$this->mIdKey) $this->mIdKey = $this->mType."_id";
Expand Down

0 comments on commit c256957

Please sign in to comment.