Skip to main content

As I can see you already created custom model for managing or interacting with custom database table.

Model class is : \Transom\Emall\Model\StoreOwner

So, use this class as factory class in your controller's __construct method as per below.

protected $_storeOwner;

public function __construct(\Transom\Emall\Model\StoreOwnerFactory $storeowner)
{
     $this->_storeOwner = $storeowner;
}


public function execute()
{
    // create a payload array of your data where key consist column name and value consist value for that columns

    $modelPayload['col1'] = $val1;
    $modelPayload['col2'] = $val2;
    $modelPayload['col3'] = $val3;
    $modelPayload['col4'] = $val4;
    
    $stobj = $_storeOwner->create();

    $stobj = $stobj->setData($modelPayload)->save();
}

if this answer helps you to build your logic then hit like.

Thank you Hiren Patel

As I can see you already created custom model for managing or interacting with custom database table.

Model class is : \Transom\Emall\Model\StoreOwner

So, use this class as factory class in your controller's __construct method as per below.

protected $_storeOwner;

public function __construct(\Transom\Emall\Model\StoreOwnerFactory $storeowner)
{
     $this->_storeOwner = $storeowner;
}


public function execute()
{
    // create a payload array of your data where key consist column name and value consist value for that columns

    $modelPayload['col1'] = $val1;
    $modelPayload['col2'] = $val2;
    $modelPayload['col3'] = $val3;
    $modelPayload['col4'] = $val4;
    
    $stobj = $_storeOwner->create();

    $stobj = $stobj->setData($modelPayload)->save();
}

if this answer helps you to build your logic then hit like.

Thank you Hiren Patel

As I can see you already created custom model for managing or interacting with custom database table.

Model class is : \Transom\Emall\Model\StoreOwner

So, use this class as factory class in your controller's __construct method as per below.

protected $_storeOwner;

public function __construct(\Transom\Emall\Model\StoreOwnerFactory $storeowner)
{
     $this->_storeOwner = $storeowner;
}


public function execute()
{
    // create a payload array of your data where key consist column name and value consist value for that columns

    $modelPayload['col1'] = $val1;
    $modelPayload['col2'] = $val2;
    $modelPayload['col3'] = $val3;
    $modelPayload['col4'] = $val4;
    
    $stobj = $_storeOwner->create();

    $stobj = $stobj->setData($modelPayload)->save();
}
Source Link

As I can see you already created custom model for managing or interacting with custom database table.

Model class is : \Transom\Emall\Model\StoreOwner

So, use this class as factory class in your controller's __construct method as per below.

protected $_storeOwner;

public function __construct(\Transom\Emall\Model\StoreOwnerFactory $storeowner)
{
     $this->_storeOwner = $storeowner;
}


public function execute()
{
    // create a payload array of your data where key consist column name and value consist value for that columns

    $modelPayload['col1'] = $val1;
    $modelPayload['col2'] = $val2;
    $modelPayload['col3'] = $val3;
    $modelPayload['col4'] = $val4;
    
    $stobj = $_storeOwner->create();

    $stobj = $stobj->setData($modelPayload)->save();
}

if this answer helps you to build your logic then hit like.

Thank you Hiren Patel