Lines
100.00%
1 / 1
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Backfill | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace BlueprintAU\Radiant\Attributes; | |
| 6 | ||
| 7 | /** | |
| 8 | * Declares the one-time value existing rows receive when the property's | |
| 9 | * column is added to a table that already has data. | |
| 10 | * | |
| 11 | * It must ride a property that also declares {@see Column}, and it is | |
| 12 | * consulted only when the column is being added — on a fresh create it | |
| 13 | * is a no-op. A null value is a mis-declaration and fails fast at | |
| 14 | * metadata build. | |
| 15 | */ | |
| 16 | #[\Attribute(\Attribute::TARGET_PROPERTY)] | |
| 17 | final class Backfill | |
| 18 | { | |
| 19 | /** | |
| 20 | * Create a backfill declaration. | |
| 21 | * | |
| 22 | * @param mixed $value A scalar or an SQL Expression — the value existing rows are backfilled with; never null. | |
| 23 | */ | |
| 24 | final public function __construct( | |
| 25 | public mixed $value, | |
| 26 | ) { | |
| 27 | } | |
| 28 | } |