| Total Complexity | 6 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class StoredSetReference extends Model implements ActsAsChild |
||
| 18 | { |
||
| 19 | use ActingAsChild; |
||
| 20 | |||
| 21 | public $table = 'pagesets'; // TODO: this should change to 'sets' to represent its generic nature. |
||
| 22 | public $guarded = []; |
||
| 23 | public $timestamps = false; |
||
| 24 | public $casts = [ |
||
| 25 | 'parameters' => 'array', |
||
| 26 | ]; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Run the query and collect the resulting pages into a Set object. |
||
| 30 | */ |
||
| 31 | 3 | public function toSet() |
|
| 32 | { |
||
| 33 | 3 | return Set::fromReference($this->toReference()); |
|
| 34 | } |
||
| 35 | |||
| 36 | 5 | public function toReference(): SetReference |
|
| 47 | } |
||
| 48 | |||
| 49 | 2 | public function flatReference(): FlatReference |
|
| 50 | { |
||
| 51 | 2 | return new FlatReference(static::class, $this->id); |
|
| 52 | } |
||
| 53 | |||
| 54 | 2 | public function flatReferenceLabel(): string |
|
| 57 | } |
||
| 58 | |||
| 59 | 2 | public function flatReferenceGroup(): string |
|
| 64 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.