File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1065,6 +1065,18 @@ public function getVariants(bool $includeDisabled = false): VariantCollection
1065
1065
return $ this ->_variants ->filter (fn (Variant $ variant ) => $ includeDisabled || ($ variant ->getStatus () === self ::STATUS_ENABLED ));
1066
1066
}
1067
1067
1068
+ /**
1069
+ * @return VariantCollection
1070
+ * @throws InvalidConfigException
1071
+ * @internal Do not use. Temporary method until we get a nested element manager provider in core.
1072
+ *
1073
+ * TODO: Remove this once we have a nested element manager provider interface in core.
1074
+ */
1075
+ public function getAllVariants (): VariantCollection
1076
+ {
1077
+ return $ this ->getVariants (true );
1078
+ }
1079
+
1068
1080
/**
1069
1081
* @inheritdoc
1070
1082
*/
@@ -1187,9 +1199,9 @@ public function getVariantManager(): NestedElementManager
1187
1199
/** @phpstan-ignore-next-line */
1188
1200
fn (Product $ product ) => self ::createVariantQuery ($ product ),
1189
1201
[
1190
- 'attribute ' => 'variants ' ,
1202
+ 'attribute ' => 'allVariants ' , // TODO: can change this back to 'variants' once we have a nested element manager provider in core.
1191
1203
'propagationMethod ' => $ this ->getType ()->propagationMethod ,
1192
- 'valueGetter ' => fn (Product $ product ) => $ product -> getVariants ( true ),
1204
+ 'valueSetter ' => fn ($ variants ) => $ this -> setVariants ( $ variants ), // TODO: can change this back to 'variants' once we have a nested element manager provider in core.
1193
1205
],
1194
1206
);
1195
1207
}
You can’t perform that action at this time.
0 commit comments