mageprince /
magento2-FAQ
| 1 | <?php |
||
| 2 | namespace Mageprince\Faq\Setup\Patch\Data; |
||
| 3 | |||
| 4 | use Magento\Eav\Setup\EavSetupFactory; |
||
|
0 ignored issues
–
show
|
|||
| 5 | use Magento\Framework\Setup\ModuleDataSetupInterface; |
||
|
0 ignored issues
–
show
The type
Magento\Framework\Setup\ModuleDataSetupInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 6 | use Magento\Framework\Setup\Patch\DataPatchInterface; |
||
|
0 ignored issues
–
show
The type
Magento\Framework\Setup\Patch\DataPatchInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 7 | |||
| 8 | class SampleFaqData implements DataPatchInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var ModuleDataSetupInterface |
||
| 12 | */ |
||
| 13 | protected $moduleDataSetup; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * SampleFaqData constructor. |
||
| 17 | * |
||
| 18 | * @param ModuleDataSetupInterface $moduleDataSetup |
||
| 19 | */ |
||
| 20 | public function __construct( |
||
| 21 | ModuleDataSetupInterface $moduleDataSetup |
||
| 22 | ) { |
||
| 23 | $this->moduleDataSetup = $moduleDataSetup; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @inheritdoc |
||
| 28 | */ |
||
| 29 | public function apply() |
||
| 30 | { |
||
| 31 | $this->moduleDataSetup->getConnection()->startSetup(); |
||
| 32 | $setup = $this->moduleDataSetup; |
||
| 33 | |||
| 34 | $faqGroupData = [ |
||
| 35 | 'groupname' => 'General', |
||
| 36 | 'sortorder' => '1', |
||
| 37 | 'storeview' => '1', |
||
| 38 | 'customer_group' => '0,1,2,3,4', |
||
| 39 | 'status' => '1' |
||
| 40 | ]; |
||
| 41 | |||
| 42 | $faqData = [ |
||
| 43 | 'title' => 'This is a test FAQ question', |
||
| 44 | 'content' => 'This is a test FAQ answer', |
||
| 45 | 'group' => '1', |
||
| 46 | 'storeview' => '1', |
||
| 47 | 'customer_group' => '0,1,2,3,4', |
||
| 48 | 'sortorder' => '0', |
||
| 49 | 'status' => '1' |
||
| 50 | ]; |
||
| 51 | |||
| 52 | $faqGroupTable = $setup->getTable('prince_faqgroup'); |
||
| 53 | $faqTable = $setup->getTable('prince_faq'); |
||
| 54 | |||
| 55 | $setup->getConnection()->insert($faqGroupTable, $faqGroupData); |
||
| 56 | $setup->getConnection()->insert($faqTable, $faqData); |
||
| 57 | $this->moduleDataSetup->getConnection()->endSetup(); |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @inheritdoc |
||
| 62 | */ |
||
| 63 | public static function getDependencies() |
||
| 64 | { |
||
| 65 | return []; |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @inheritdoc |
||
| 70 | */ |
||
| 71 | public function getAliases() |
||
| 72 | { |
||
| 73 | return []; |
||
| 74 | } |
||
| 75 | } |
||
| 76 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths