Example #1
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $avroDataObject = Mage::getModel('xcom_chronicle/message_order', array('order' => $dataObject->getOrder(), 'type' => 'regular'));
     $data = array('cancelledOrders' => array($avroDataObject->toArray()));
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #2
0
 /**
  * @param null|Varien_Object $dataObject the data object to use
  * @return Xcom_Xfabric_Model_Message_Request the outbound message
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $avroDataObject = Mage::getModel('xcom_chronicle/message_inventory_stock_item', array('stock_item' => $dataObject->getStockItem(), 'product_sku' => $dataObject->getProductSku()));
     $data = array('stockItems' => array($avroDataObject->toArray()));
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #3
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $avroDataObject = Mage::getModel('xcom_chronicle/message_webstore_offer', array('product' => $dataObject->getProduct(), 'store_id' => $dataObject->getStoreId()));
     $data = array('offer' => $avroDataObject->toArray());
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #4
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $this->setIsWaitResponse();
     $data = array('payload' => null);
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #5
0
 /**
  * @dataProvider encodingProvider
  */
 public function testPrepareHeadersWithJsonHeader($encoding, $header)
 {
     $this->_object->setEncoding($encoding);
     $this->assertInstanceOf($this->_instanceOf, $this->_object->prepareHeaders());
     $headers = $this->_object->getHeaders();
     $this->assertEquals($header, "Content-Type: " . $headers['Content-Type']);
 }
Example #6
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $avroDataObject = Mage::getModel('xcom_chronicle/message_product', $dataObject->getProduct());
     $data = array('products' => array($avroDataObject->toArray()));
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #7
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $avroDataObject = Mage::getModel('xcom_chronicle/message_customer_guest', $dataObject->getOrder());
     $data = array('data' => $avroDataObject->toArray());
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #8
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     /** @var $avroDataObject Xcom_Chronicle_Model_Message_Webstore_Offer */
     $avroDataObject = Mage::getModel('xcom_chronicle/message_webstore_offer', array('product' => $dataObject->getProduct(), 'store_id' => $dataObject->getStoreId()));
     $data = array('sku' => $avroDataObject->getSku(), 'quantity' => $avroDataObject->getQuantity(), 'webStoreId' => $avroDataObject->getWebStoreId());
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #9
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     /* @var $orderMessage Xcom_Chronicle_Model_Message_Order */
     $orderMessage = Mage::getModel('xcom_chronicle/message_order', array('order' => $dataObject->getOrder(), 'type' => 'simple'));
     $data = $orderMessage->getRecord('PartialOrderReturn', array($dataObject->getCreditMemo()));
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #10
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $data = $dataObject->getData();
     $this->addHeader(Xcom_Xfabric_Model_Message_Abstract::CORRELATION_ID_HEADER, $data['correlation_id']);
     unset($data['correlation_id']);
     unset($data['destination_id']);
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #11
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $data = array('ids' => null, 'filter' => null, 'locales' => null);
     if ($dataObject != null) {
         $data = array('ids' => $dataObject['ids'], 'filter' => $dataObject['filter'], 'locales' => $dataObject['locales']);
     }
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #12
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $data = array('query' => array('fields' => null, 'predicates' => null, 'ordering' => null, 'numberItems' => null, 'startItemIndex' => null, 'numberItemsFound' => null), 'locales' => null);
     if ($dataObject != null) {
         $data = array('query' => array('fields' => $dataObject["fields"], 'predicates' => $dataObject["predicates"], 'ordering' => $dataObject["ordering"], 'numberItems' => $dataObject["numberItems"], 'startItemIndex' => $dataObject["startItemIndex"], 'numberItemsFound' => $dataObject["numberItemsFound"]), 'locales' => null);
     }
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #13
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $numberItems = null;
     $startItemIndex = null;
     if ($dataObject != null) {
         $numberItems = $dataObject["numberItems"];
         $startItemIndex = $dataObject->getStartItemIndex();
     }
     $data = array('query' => array('numberItems' => $numberItems, 'numberItemsFound' => null, 'fields' => null, 'predicates' => null, 'ordering' => array(), 'startItemIndex' => $dataObject["startItemIndex"]));
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #14
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $data = array('channelAssignedOfferIds' => $dataObject->getOfferIds(), 'policyGroupId' => null);
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #15
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $result = Mage::getModel('xcom_chronicle/message_marketplaceshipment', $dataObject->getShipment());
     $this->setMessageData($result->toArray());
     return parent::_prepareData($dataObject);
 }
Example #16
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $data = array();
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
Example #17
0
 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $data = array('payload' => $dataObject ? $dataObject->getPayload() : null);
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }