Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
| Mailtemplate | |
0.00% |
0 / 10 |
|
0.00% |
0 / 6 |
110 | |
0.00% |
0 / 1 |
| getDefaults | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getNotificationPreferences | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| hasType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| hasPreference | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
12 | |||
| getPreference | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setPreference | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsentities; |
| 4 | |
| 5 | class Mailtemplate extends Schema\Entity |
| 6 | { |
| 7 | public static $schema = "mailtemplate.json"; |
| 8 | |
| 9 | public function getDefaults() |
| 10 | { |
| 11 | return [ |
| 12 | ]; |
| 13 | } |
| 14 | |
| 15 | public function getNotificationPreferences() |
| 16 | { |
| 17 | return $this->toProperty()->notifications->get(); |
| 18 | } |
| 19 | |
| 20 | public function hasType($type) |
| 21 | { |
| 22 | return (isset($this[$type])) ? true : false; |
| 23 | } |
| 24 | |
| 25 | public function hasPreference($type, $key) |
| 26 | { |
| 27 | return ($this->hasType($type) && isset($this[$type][$key])) ? true : false; |
| 28 | } |
| 29 | |
| 30 | public function getPreference($type, $key) |
| 31 | { |
| 32 | return $this->toProperty()->$type->$key->get(); |
| 33 | } |
| 34 | |
| 35 | public function setPreference($type, $key, $value) |
| 36 | { |
| 37 | $preference = $this->toProperty()->$type->$key->get(); |
| 38 | if (null !== $preference) { |
| 39 | $this[$type][$key] = $value; |
| 40 | } |
| 41 | return $this; |
| 42 | } |
| 43 | } |