| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function generatePrimaryKey() |
||
| 45 | { |
||
| 46 | $structure = $this->getTableStructure(); |
||
|
|
|||
| 47 | $primaryKey = false; |
||
| 48 | if (is_array($structure) && isset($structure['indexes']['PRIMARY']['fields'])) { |
||
| 49 | $primaryKey = $structure['indexes']['PRIMARY']['fields']; |
||
| 50 | if (count($primaryKey) == 1) { |
||
| 51 | $primaryKey = reset($primaryKey); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 55 | return $primaryKey; |
||
| 56 | } |
||
| 58 |