| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 30 | public function up() |
||
| 31 | { |
||
| 32 | $name = $this->getName(); |
||
| 33 | |||
| 34 | // Check if the setting exists |
||
| 35 | $command = $this->dbConnection->createCommand('SELECT * FROM settings WHERE name = :name'); |
||
| 36 | $settingExists = $command->queryRow(true, array(':name' => $name)) !== false; |
||
| 37 | |||
| 38 | if ($settingExists) |
||
| 39 | return true; |
||
|
|
|||
| 40 | |||
| 41 | $this->insert('settings', array( |
||
| 42 | 'name'=>$name, |
||
| 43 | 'value'=>(string)$this->getDefaultValue())); |
||
| 44 | } |
||
| 55 | } |