Last active
August 29, 2015 14:14
-
-
Save davefreiman/dde46d26644472a432a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function run() | |
{ | |
if ($this->getArg(0)) { | |
$profileId = $this->getArg(0); | |
} | |
if (isset($profileId)){ | |
$profile = Mage::getModel('dataflow/profile'); | |
$userModel = Mage::getModel('admin/user'); | |
$userModel->setUserId(0); | |
Mage::getSingleton('admin/session')->setUser($userModel); | |
$profile->load($profileId); | |
if (!$profile->getId()) { | |
Mage::getSingleton('adminhtml/session')->addError('ERROR: Incorrect profile id'); | |
} | |
Mage::register('current_convert_profile', $profile); | |
$profile->run(); | |
$batchModel = Mage::getSingleton('dataflow/batch'); | |
echo "EXPORT COMPLETE. BATCHID: " . $batchModel->getId(); | |
} | |
else { | |
echo $this->usageHelp(); | |
} | |
} | |
/** | |
* Retrieve Usage Help Message | |
* | |
*/ | |
public function usageHelp() | |
{ | |
return <<<USAGE | |
Usage: php dataflow_export.php -- [profile_id] | |
profile_id Specified dataflow profile to run | |
USAGE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment