| @@ -3,8 +3,9 @@ | ||
| 3 | 3 | namespace Give\Framework\FieldsAPI; |
| 4 | 4 | |
| 5 | 5 | use Give\Framework\FieldsAPI\Contracts\Node; |
| 6 | 6 | use Give\Framework\FieldsAPI\Exceptions\EmptyNameException; |
| 7 | +use Give\Framework\FieldsAPI\ValueObjects\PersistenceScope; | |
| 7 | 8 | use Give\Vendors\StellarWP\Validation\Concerns\HasValidationRules; |
| 8 | 9 | |
| 9 | 10 | /** |
| 10 | 11 | * @since 2.27.3 add ShowInAdmin, ShowInReceipt, StoreAsMeta |
| @@ -17,8 +18,9 @@ | ||
| 17 | 18 | { |
| 18 | 19 | use Concerns\HasDefaultValue; |
| 19 | 20 | use Concerns\HasName; |
| 20 | 21 | use Concerns\HasType; |
| 22 | + use Concerns\HasPersistence; | |
| 21 | 23 | use Concerns\IsReadOnly; |
| 22 | 24 | use Concerns\IsRequired; |
| 23 | 25 | use Concerns\Macroable; |
| 24 | 26 | use Concerns\SerializeAsJson; |
| @@ -24,9 +26,8 @@ | ||
| 24 | 26 | use Concerns\SerializeAsJson; |
| 25 | 27 | use Concerns\TapNode; |
| 26 | 28 | use Concerns\ShowInAdmin; |
| 27 | 29 | use Concerns\ShowInReceipt; |
| 28 | - use Concerns\StoreAsMeta; | |
| 29 | 30 | use Concerns\HasVisibilityConditions { |
| 30 | 31 | Concerns\HasVisibilityConditions::__construct as private __visibilityConditionsConstruct; |
| 31 | 32 | } |
| 32 | 33 | use HasValidationRules { |
| @@ -33,10 +34,11 @@ | ||
| 33 | 34 | HasValidationRules::__construct as private __validationRulesConstruct; |
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | /** |
| 37 | - * @since 2.12.0 | |
| 38 | - * @since 2.23.1 Make constructor final to avoid unsafe usage of `new static()`. | |
| 38 | + * @since 2.32.0 sets the default scope to donation | |
| 39 | + * @since 2.23.1 make constructor final to avoid unsafe usage of `new static()`. | |
| 40 | + * @since 2.12.0 | |
| 39 | 41 | * |
| 40 | 42 | * @throws EmptyNameException |
| 41 | 43 | */ |
| 42 | 44 | final public function __construct(string $name) |
| @@ -45,8 +47,9 @@ | ||
| 45 | 47 | throw new EmptyNameException(); |
| 46 | 48 | } |
| 47 | 49 | |
| 48 | 50 | $this->name = $name; |
| 51 | + $this->scope = PersistenceScope::donation(); | |
| 49 | 52 | $this->__validationRulesConstruct(); |
| 50 | 53 | $this->__visibilityConditionsConstruct(); |
| 51 | 54 | } |
| 52 | 55 | |