| Conditions | 5 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function autoIncrement($table, $column, $triggerName, $sequenceName) |
||
| 32 | { |
||
| 33 | if (! $table or ! $column or ! $triggerName or ! $sequenceName) { |
||
| 34 | return false; |
||
| 35 | } |
||
| 36 | |||
| 37 | return $this->connection->statement(" |
||
| 38 | create trigger $triggerName |
||
| 39 | before insert on {$table} |
||
| 40 | for each row |
||
| 41 | begin |
||
| 42 | if :new.{$column} is null then |
||
| 43 | select {$sequenceName}.nextval into :new.{$column} from dual; |
||
| 44 | end if; |
||
| 45 | end;"); |
||
| 46 | } |
||
| 47 | |||
| 72 |