| @@ 98-103 (lines=6) @@ | ||
| 95 | ||
| 96 | public function getFirstKey($table){ |
|
| 97 | $result=null; |
|
| 98 | foreach ($this->tables[$table]["properties"] as $property){ |
|
| 99 | if(!isset($result)) |
|
| 100 | $result=$property["name"]; |
|
| 101 | if(isset($property["pk"]) && $property["pk"]) |
|
| 102 | return $property["name"]; |
|
| 103 | } |
|
| 104 | return $result; |
|
| 105 | } |
|
| 106 | ||
| @@ 117-120 (lines=4) @@ | ||
| 114 | ||
| 115 | public function getPrimaryKeys($table){ |
|
| 116 | $result=[]; |
|
| 117 | foreach ($this->tables[$table]["properties"] as $property){ |
|
| 118 | if(isset($property["pk"]) && $property["pk"]) |
|
| 119 | $result[]=$property["name"]; |
|
| 120 | } |
|
| 121 | return $result; |
|
| 122 | } |
|
| 123 | ||