I am practicing with the development of mageplaza modules. following the steps of the blog, but I don't know if my InstallData.php
is badly created, but nothing is loaded to the database. I have the module created on github https://github.com/GNUXDAR/magento2_code/tree/development
<?php
namespace Actecnology\HellorWorld\Setup;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
class InstallData implements InstallDataInterface
{
private $eavSetupFactory;
public function __construct(EavSetupFactory $eavSetupFactory)
{
$this->eavSetupFactory = $eavSetupFactory;
}
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
/**
* Install messages
*/
$data = [
'name' => "Bienvenidos al mundo del desarrollo de modulos de Magento2",
'url_key' => '/magento-2-module-development/wellcome.html',
'post_content' => "En este articulo de prueba, le damos la bienvenida al desarrollo de modulos e integracion de magento, como sabemos magento2 es un sistema modular, en el cual desarrollaremos modulos necesarios para nuestro modelo de negocio.",
'tags' => 'magento 2,development',
'featured_image'=> 'https://arturocabrera.com/img/slides/1.webp',
'author' => "@gnuxdar",
'status' => 1
];
foreach ($data as $bind) {
$setup->getConnection()
->insertForce($setup->getTable('actecnology_helloworld_post'), $bind);
}
}
}
with DataPatches show that message:
Cache types config flushed successfully
Cache cleared successfully
File system cleanup:
/var/www/html/act_magento/generated/code/Composer
/var/www/html/act_magento/generated/code/Dotdigitalgroup
/var/www/html/act_magento/generated/code/Magento
/var/www/html/act_magento/generated/code/PayPal
/var/www/html/act_magento/generated/code/Psr
/var/www/html/act_magento/generated/code/Symfony
/var/www/html/act_magento/generated/code/Vertex
/var/www/html/act_magento/generated/code/Yotpo
The directory '/var/www/html/act_magento/generated/metadata/' doesn't exist - skipping cleanup
Updating modules:
Cache cleared successfully
Schema creation/updates:
Primary db_schema file doesn`t exists