| Total Complexity | 5 |
| Total Lines | 75 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class DataRole extends Model implements \BristolSU\ControlDB\Contracts\Models\DataRole |
||
| 17 | { |
||
| 18 | use SoftDeletes, HasAdditionalProperties, DataRoleTrait { |
||
| 19 | setRoleName as baseSetRoleName; |
||
| 20 | setEmail as baseSetEmail; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * The table to use |
||
| 25 | * |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected $table = 'control_data_role'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Fillable attributes |
||
| 32 | * |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | protected $fillable = [ |
||
| 36 | 'role_name', 'email' |
||
| 37 | ]; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get the ID of the role |
||
| 41 | * |
||
| 42 | * @return int |
||
| 43 | */ |
||
| 44 | 25 | public function id(): int |
|
| 45 | { |
||
| 46 | 25 | return $this->id; |
|
| 47 | } |
||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | /** |
||
| 52 | * Get the email of the role |
||
| 53 | * |
||
| 54 | * @return string|null |
||
| 55 | */ |
||
| 56 | 9 | public function email(): ?string |
|
| 57 | { |
||
| 58 | 9 | return $this->email; |
|
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Get the name for the role |
||
| 63 | * |
||
| 64 | * @return string|null |
||
| 65 | */ |
||
| 66 | 9 | public function roleName(): ?string |
|
| 67 | { |
||
| 68 | 9 | return $this->role_name; |
|
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Set the email of the role |
||
| 73 | * |
||
| 74 | * @param string|null $email |
||
| 75 | */ |
||
| 76 | 2 | public function setEmail(?string $email): void |
|
| 80 | 2 | } |
|
| 81 | |||
| 82 | /** |
||
| 83 | * Set a name for the role |
||
| 84 | * |
||
| 85 | * @param string|null $roleName |
||
| 86 | */ |
||
| 87 | 2 | public function setRoleName(?string $roleName): void |
|
| 94 | } |