I have a function from a 3rd party plugin that uploads data using a CSV. The beginning of the function in the resource model that does the work looks like this
public function uploadAndImport(MagentoFrameworkDataObject $object)
{
try {
...
I want to call this function using a cron job (which is already set up), and call this with a csv every 15 minutes. How can I pass the csv to this function?
This is what my cron job looks like now
<?php
namespace companyImportCustomerpricingCron;
use MagentoFrameworkAppObjectManager;
use PsrLogLoggerInterface;
use MagedelightCustomerpriceModelResourceModelCustomerprice;
class ImportPricing {
protected $logger;
protected $customerprice;
public function __construct(LoggerInterface $logger, Customerprice $customerprice) {
$this->logger = $logger;
$this->customerprice = $customerprice;
}
/**
* Write to system.log
*
* @return void
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function execute() {
//$this->logger->info('Cron Works');
$this->customerprice->uploadAndImport();
}
}