1

have this custom model:

class Mynamespace_Mymodule_Model_Convert_Adapter_Unblock extends Mage_Dataflow_Model_Convert_Adapter_Abstract
{
    protected $_customerModel;

    public function load()
    {
        // Stub
    }

    public function save()
    {
        // Stub
    }

    public function getCustomerModel()
    {
        if (is_null($this->_customerModel)) {
            $_customer = Mage::getModel('customer/customer');
            $this->_customerModel = Mage::objects()->save($_customer);
        }
        return Mage::objects()->load($this->_customerModel);
    }

    public function saveRow(array $importData)
    {
        $_customer = $this->getCustomerModel();

        if (empty($importData['reference'])) {
            $message = Mage::helper('catalog')->__('Skip import row, required field "%s" not defined', 'reference');
            Mage::throwException($message);
        }
        //   .......  code here
        return true;
    }
}

It reads a custom csv file from var/import/custom.csv. It has only one column called reference . Its a dataflow profile

My silly questions are:

How can I run it ? Is it possible to run it from console? If Yes, HOW ? I am using n98-magerun. Is it possible to run it from it ? if Yes, How ?

Thank you :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.