| Total Complexity | 5 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class DataGroup extends Model implements \BristolSU\ControlDB\Contracts\Models\DataGroup |
||
| 14 | { |
||
| 15 | use SoftDeletes, HasAdditionalProperties, DataGroupTrait { |
||
| 16 | setName as baseSetName; |
||
| 17 | setEmail as baseSetEmail; |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Define the table to use |
||
| 22 | * |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $table = 'control_data_group'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Define fillable attributes |
||
| 29 | * |
||
| 30 | * @var array |
||
| 31 | */ |
||
| 32 | protected $fillable = [ |
||
| 33 | 'name', 'email' |
||
| 34 | ]; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Gets the ID of the group |
||
| 38 | * |
||
| 39 | * @return int |
||
| 40 | */ |
||
| 41 | 26 | public function id(): int |
|
| 42 | { |
||
| 43 | 26 | return $this->id; |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Gets the name of the group |
||
| 48 | * |
||
| 49 | * @return string|null |
||
| 50 | */ |
||
| 51 | 10 | public function name(): ?string |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Gets the email of the group |
||
| 58 | * |
||
| 59 | * @return string|null |
||
| 60 | */ |
||
| 61 | 10 | public function email(): ?string |
|
| 62 | { |
||
| 63 | 10 | return $this->email; |
|
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Set the name of the group |
||
| 68 | * |
||
| 69 | * @param string|null $name |
||
| 70 | */ |
||
| 71 | 2 | public function setName(?string $name): void |
|
| 72 | { |
||
| 73 | 2 | $this->baseSetName($name); |
|
| 74 | 2 | $this->refresh(); |
|
| 75 | 2 | } |
|
| 76 | |||
| 77 | /** |
||
| 78 | * Set the email of the group |
||
| 79 | * |
||
| 80 | * @param string|null $email |
||
| 81 | */ |
||
| 82 | 2 | public function setEmail(?string $email): void |
|
| 86 | |||
| 87 | 2 | } |
|
| 88 | |||
| 89 | |||
| 90 | } |