| Total Complexity | 5 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class DataPosition extends Model implements \BristolSU\ControlDB\Contracts\Models\DataPosition |
||
| 16 | { |
||
| 17 | use SoftDeletes, HasAdditionalProperties, DataPositionTrait { |
||
| 18 | setName as baseSetName; |
||
| 19 | setDescription as baseSetDescription; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Defines the table |
||
| 24 | * |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | protected $table = 'control_data_position'; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Defines the fillable properties |
||
| 31 | * |
||
| 32 | * @var array |
||
| 33 | */ |
||
| 34 | protected $fillable = [ |
||
| 35 | 'name', 'description' |
||
| 36 | ]; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * ID of the position |
||
| 40 | * |
||
| 41 | * @return int |
||
| 42 | */ |
||
| 43 | 25 | public function id(): int |
|
| 44 | { |
||
| 45 | 25 | return $this->id; |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Name of the position |
||
| 50 | * |
||
| 51 | * @return string|null |
||
| 52 | */ |
||
| 53 | 9 | public function name(): ?string |
|
| 54 | { |
||
| 55 | 9 | return $this->name; |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Description for the position. |
||
| 60 | * |
||
| 61 | * @return string|null |
||
| 62 | */ |
||
| 63 | 8 | public function description(): ?string |
|
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Set the position name |
||
| 70 | * |
||
| 71 | * @param string|null $name |
||
| 72 | */ |
||
| 73 | 2 | public function setName(?string $name): void |
|
| 74 | { |
||
| 75 | 2 | $this->baseSetName($name); |
|
| 76 | 2 | $this->refresh(); |
|
| 77 | 2 | } |
|
| 78 | |||
| 79 | /** |
||
| 80 | * Set the description |
||
| 81 | * |
||
| 82 | * @param string|null $description |
||
| 83 | */ |
||
| 84 | 2 | public function setDescription(?string $description): void |
|
| 88 | 2 | } |
|
| 89 | |||
| 90 | |||
| 91 | } |