Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function getNextId() |
||
15 | { |
||
16 | $table = $this->getEntity()->getTableName(); |
||
17 | |||
18 | $sql = "SELECT CASE WHEN MAX(RESOURCE_ID) IS NULL THEN 1 ELSE MAX(RESOURCE_ID) + 1 END AS RESOURCE_ID FROM $table"; |
||
19 | |||
20 | $this->getDriver()->getDb()->execute($sql); |
||
21 | $rowset = $this->getDriver()->getDb()->getArrayResult(); |
||
22 | $row = array_shift($rowset); |
||
23 | |||
24 | return $row["RESOURCE_ID"]; |
||
25 | } |
||
26 | } |