17
17
use Magento \Framework \Exception \LocalizedException ;
18
18
use Magento \Framework \Setup \ModuleDataSetupInterface ;
19
19
use Magento \Framework \Setup \Patch \DataPatchInterface ;
20
+ use Magento \Framework \Validator \ValidateException ;
20
21
use Magento \Store \Model \Store ;
21
- use Zend_Validate_Exception ;
22
22
23
23
final class ProductAttributes implements DataPatchInterface
24
24
{
@@ -39,8 +39,8 @@ public static function getDependencies(): array
39
39
}
40
40
41
41
/**
42
- * @throws Zend_Validate_Exception
43
42
* @throws LocalizedException
43
+ * @throws ValidateException
44
44
*/
45
45
public function apply ()
46
46
{
@@ -55,6 +55,10 @@ public function apply()
55
55
$ this ->moduleDataSetup ->endSetup ();
56
56
}
57
57
58
+ /**
59
+ * @throws LocalizedException
60
+ * @throws ValidateException
61
+ */
58
62
private function addAttributes (EavSetup $ eavSetup ): void
59
63
{
60
64
$ eavSetup ->addAttribute (Product::ENTITY , 'is_purchasable ' , [
@@ -107,7 +111,7 @@ private function addDefaultValues(EavSetup $eavSetup): void
107
111
$ this ->addDefaultValue ($ eavSetup , $ eavSetup ->getAttribute (Product::ENTITY , $ attributeCode ));
108
112
}
109
113
}
110
-
114
+
111
115
private function addDefaultValue (EavSetup $ eavSetup , array $ attribute ): void
112
116
{
113
117
$ connection = $ this ->productResource ->getConnection ();
0 commit comments