Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
91.67% |
11 / 12 |
|
83.33% |
5 / 6 |
CRAP | |
0.00% |
0 / 1 |
| Client | |
91.67% |
11 / 12 |
|
83.33% |
5 / 6 |
10.06 | |
0.00% |
0 / 1 |
| getDefaults | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |||
| hasFamilyName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| hasEmail | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| hasTelephone | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| getEmailSendCount | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| hasSurveyAccepted | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsentities; |
| 4 | |
| 5 | class Client extends Schema\Entity |
| 6 | { |
| 7 | public static $schema = "client.json"; |
| 8 | |
| 9 | public function getDefaults() |
| 10 | { |
| 11 | return [ |
| 12 | 'familyName' => '', |
| 13 | 'email' => '', |
| 14 | 'emailSendCount' => 0, |
| 15 | 'surveyAccepted' => false, |
| 16 | 'telephone' => '' |
| 17 | ]; |
| 18 | } |
| 19 | |
| 20 | public function hasFamilyName() |
| 21 | { |
| 22 | return ($this->toProperty()->familyName->get()) ? true : false; |
| 23 | } |
| 24 | |
| 25 | public function hasEmail() |
| 26 | { |
| 27 | return ($this->toProperty()->email->get()) ? true : false; |
| 28 | } |
| 29 | |
| 30 | public function hasTelephone() |
| 31 | { |
| 32 | return ($this->toProperty()->telephone->get()) ? true : false; |
| 33 | } |
| 34 | |
| 35 | public function getEmailSendCount() |
| 36 | { |
| 37 | return $this->toProperty()->emailSendCount->get(); |
| 38 | } |
| 39 | |
| 40 | public function hasSurveyAccepted() |
| 41 | { |
| 42 | return (1 == $this->toProperty()->surveyAccepted->get()) ? true : false; |
| 43 | } |
| 44 | } |