Skip to content

Instantly share code, notes, and snippets.

@danielholmstrom
Last active August 29, 2015 13:56
Show Gist options
  • Save danielholmstrom/9253130 to your computer and use it in GitHub Desktop.
Save danielholmstrom/9253130 to your computer and use it in GitHub Desktop.
<?php
interface ExportLogger {
function info();
function debug();
function warning();
function error();
function fatal();
}
class Made_Integration_Model_Export implements ExportLogger
{
function info();
function debug();
function warning();
function error();
function fatal();
public function export($type, $object, $data = null)
{
$adapters = Mage::helper('integration')->getExportAdapters();
if (empty($adapters)) {
return false;
}
foreach ($adapters as $adapter) {
try {
$adapter->export($type, $object, $data, $this);
$this->registerExportNotification($type, $adapter, $object, $data);
} catch (Exception $e) {
$this->registerFailureNotification($type, $adapter, $object, $data, $e);
}
}
}
}
interface ExportAdapterInterface {
function export($type, $object, $data, $logger);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment