Code Coverage  | 
      ||||||||||
Lines  | 
       Functions and Methods  | 
       Classes and Traits  | 
      ||||||||
| Total |         | 
       0.00%  | 
       0 / 3  | 
               | 
       0.00%  | 
       0 / 3  | 
       CRAP |         | 
       0.00%  | 
       0 / 1  | 
      
| RelationAbstract |         | 
       0.00%  | 
       0 / 3  | 
               | 
       0.00%  | 
       0 / 3  | 
       12 |         | 
       0.00%  | 
       0 / 1  | 
      
| getId |         | 
       0.00%  | 
       0 / 1  | 
               | 
       0.00%  | 
       0 / 1  | 
       2 | |||
| setDuty |         | 
       0.00%  | 
       0 / 1  | 
               | 
       0.00%  | 
       0 / 1  | 
       2 | |||
| getDuty |         | 
       0.00%  | 
       0 / 1  | 
               | 
       0.00%  | 
       0 / 1  | 
       2 | |||
| getRelation | n/a  | 
       0 / 0  | 
       n/a  | 
       0 / 0  | 
       0 | |||||
| jsonSerialize | n/a  | 
       0 / 0  | 
       n/a  | 
       0 / 0  | 
       0 | |||||
| 1 | <?php | 
| 2 | /** | 
| 3 | * Jingga | 
| 4 | * | 
| 5 | * PHP Version 8.1 | 
| 6 | * | 
| 7 | * @package Modules\Tasks\Models | 
| 8 | * @copyright Dennis Eichhorn | 
| 9 | * @license OMS License 2.0 | 
| 10 | * @version 1.0.0 | 
| 11 | * @link https://jingga.app | 
| 12 | */ | 
| 13 | declare(strict_types=1); | 
| 14 | |
| 15 | namespace Modules\Tasks\Models; | 
| 16 | |
| 17 | use Modules\Admin\Models\Account; | 
| 18 | use Modules\Admin\Models\Group; | 
| 19 | |
| 20 | /** | 
| 21 | * Task relation to accounts or groups | 
| 22 | * | 
| 23 | * @package Modules\Tasks\Models | 
| 24 | * @license OMS License 2.0 | 
| 25 | * @link https://jingga.app | 
| 26 | * @since 1.0.0 | 
| 27 | */ | 
| 28 | abstract class RelationAbstract implements \JsonSerializable | 
| 29 | { | 
| 30 | /** | 
| 31 | * ID. | 
| 32 | * | 
| 33 | * @var int | 
| 34 | * @since 1.0.0 | 
| 35 | */ | 
| 36 | public int $id = 0; | 
| 37 | |
| 38 | /** | 
| 39 | * Duty. | 
| 40 | * | 
| 41 | * @var int | 
| 42 | * @since 1.0.0 | 
| 43 | */ | 
| 44 | public int $duty = DutyType::TO; | 
| 45 | |
| 46 | /** | 
| 47 | * Element id. | 
| 48 | * | 
| 49 | * @var int | 
| 50 | * @since 1.0.0 | 
| 51 | */ | 
| 52 | public int $element = 0; | 
| 53 | |
| 54 | /** | 
| 55 | * Get id. | 
| 56 | * | 
| 57 | * @return int | 
| 58 | * | 
| 59 | * @since 1.0.0 | 
| 60 | */ | 
| 61 | public function getId() : int | 
| 62 | { | 
| 63 | return $this->id; | 
| 64 | } | 
| 65 | |
| 66 | /** | 
| 67 | * Set the duty (TO or CC) | 
| 68 | * | 
| 69 | * @param int $duty Is TO or CC | 
| 70 | * | 
| 71 | * @return void | 
| 72 | * | 
| 73 | * @since 1.0.0 | 
| 74 | */ | 
| 75 | public function setDuty(int $duty) : void | 
| 76 | { | 
| 77 | $this->duty = $duty; | 
| 78 | } | 
| 79 | |
| 80 | /** | 
| 81 | * Get the duty (TO or CC) | 
| 82 | * | 
| 83 | * @return int Is TO or CC | 
| 84 | * | 
| 85 | * @since 1.0.0 | 
| 86 | */ | 
| 87 | public function getDuty() : int | 
| 88 | { | 
| 89 | return $this->duty; | 
| 90 | } | 
| 91 | |
| 92 | /** | 
| 93 | * Get the relation object | 
| 94 | * | 
| 95 | * @return Account|Group | 
| 96 | * | 
| 97 | * @since 1.0.0 | 
| 98 | */ | 
| 99 | abstract public function getRelation(); | 
| 100 | |
| 101 | /** | 
| 102 | * {@inheritdoc} | 
| 103 | */ | 
| 104 | abstract public function jsonSerialize() : mixed; | 
| 105 | } |