| Code Coverage
| Classes and Traits | Functions and Methods | Lines
Total | 100.00% covered (success) | 100.00% | 1 / 1 | 100.00% covered (success) | 100.00% | 2 / 2 | CRAP | 100.00% covered (success) | 100.00% | 8 / 8
Module | 100.00% covered (success) | 100.00% | 1 / 1 | 100.00% covered (success) | 100.00% | 2 / 2 | 3 | 100.00% covered (success) | 100.00% | 8 / 8
install | 100.00% covered (success) | 100.00% | 1 / 1 | 2 | 100.00% covered (success) | 100.00% | 6 / 6
getActivated | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 2 / 2

1 | <?php
2 |
3 | namespace Entity;
4 |
5 | class Module extends ModelBase
6 | {
7 | protected function install()
8 | {
9 | $dbPrefix = $this->getDbPrefix();
10 | $result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}module` (
11 | `id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
12 | `name` VARCHAR(128) NOT NULL,
13 | `description` VARCHAR(255) NOT NULL,
14 | `directory` VARCHAR(255) NOT NULL,
15 | `active` BOOLEAN DEFAULT FALSE NOT NULL
16 | )");
17 | if ($result === false)
18 | throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
19 | return true;
20 | }
21 |
22 | public static function getActivated()
23 | {
24 | $fetcher = new self();
25 | return $fetcher->selects(array("active" => true));
26 | }
27 | }
28 |