当前位置: 首页>>代码示例>>PHP>>正文


PHP Ess_M2ePro_Model_Account::getChildObject方法代码示例

本文整理汇总了PHP中Ess_M2ePro_Model_Account::getChildObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Account::getChildObject方法的具体用法?PHP Ess_M2ePro_Model_Account::getChildObject怎么用?PHP Ess_M2ePro_Model_Account::getChildObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ess_M2ePro_Model_Account的用法示例。


在下文中一共展示了Ess_M2ePro_Model_Account::getChildObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 public function process()
 {
     if (!is_null($this->account)) {
         $this->requestExtraData['account'] = $this->account->getChildObject()->getServerHash();
     }
     parent::process();
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:7,代码来源:Requester.php

示例2: process

 public function process()
 {
     if (!is_null($this->account)) {
         $this->requestExtraData['account'] = $this->account->getChildObject()->getTranslationHash();
     }
     return parent::process();
 }
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:7,代码来源:Abstract.php

示例3: process

 public function process()
 {
     if (!is_null($this->account) && !is_null($this->marketplace)) {
         /** @var $amazonAccount Ess_M2ePro_Model_Amazon_Account */
         $amazonAccount = $this->account->getChildObject();
         $marketplaceDataTemp = $amazonAccount->getMarketplaceItem($this->marketplace->getId());
         if (!is_null($marketplaceDataTemp)) {
             $this->requestExtraData['account'] = $marketplaceDataTemp['server_hash'];
         }
     }
     parent::process();
 }
开发者ID:xiaoguizhidao,项目名称:beut,代码行数:12,代码来源:Requester.php

示例4: process

 public function process()
 {
     if (!is_null($this->marketplace)) {
         $this->requestExtraData['marketplace'] = $this->marketplace->getNativeId();
     }
     if (!is_null($this->account)) {
         $this->requestExtraData['account'] = $this->account->getChildObject()->getServerHash();
     }
     if (!is_null($this->mode)) {
         $this->requestExtraData['mode'] = $this->mode;
     }
     parent::process();
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:13,代码来源:Requester.php

示例5: getOrdersForRelease

 private function getOrdersForRelease(Ess_M2ePro_Model_Account $account)
 {
     /** @var Ess_M2ePro_Model_Mysql4_Order_Collection $collection */
     $collection = Mage::helper('M2ePro/Component_Amazon')->getCollection('Order')->addFieldToFilter('account_id', $account->getId())->addFieldToFilter('reservation_state', Ess_M2ePro_Model_Order_Reserve::STATE_PLACED);
     $reservationDays = (int) $account->getChildObject()->getQtyReservationDays();
     $minReservationStartDate = new DateTime(Mage::helper('M2ePro')->getCurrentGmtDate(), new DateTimeZone('UTC'));
     $minReservationStartDate->modify('- ' . $reservationDays . ' days');
     $minReservationStartDate = $minReservationStartDate->format('Y-m-d H:i');
     $collection->addFieldToFilter('reservation_start_date', array('lteq' => $minReservationStartDate));
     return $collection->getItems();
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:11,代码来源:Cancellation.php

示例6: updateLinksByPages

 private function updateLinksByPages(Ess_M2ePro_Model_Account $account)
 {
     $inputData = array('necessary_status' => 2, 'necessary_page' => 1);
     $settings = $account->getChildObject()->getDecodedListingsUpdateLinksSettings();
     if (!is_null($settings)) {
         $inputData['necessary_status'] = (int) $settings['next_status'];
         $inputData['necessary_page'] = (int) $settings['next_page'];
     }
     $responseData = Mage::getModel('M2ePro/Connector_Play_Dispatcher')->processVirtual('inventory', 'get', 'pagesProductsLinks', $inputData, NULL, $account->getId());
     $this->updateReceivedLinks($responseData);
     $pagesSettings = $this->calculateNextPagesSettings($responseData, $inputData);
     $account->getChildObject()->setData('listings_update_links_settings', $pagesSettings)->save();
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:13,代码来源:GettingProductsLinks.php

示例7: processAmazonOrders

 private function processAmazonOrders($response, Ess_M2ePro_Model_Account $account)
 {
     /** @var Ess_M2ePro_Model_Amazon_Account $amazonAccount */
     $amazonAccount = $account->getChildObject();
     $ordersLastSynchronization = $amazonAccount->getData('orders_last_synchronization');
     $orders = array();
     foreach ($response as $orderData) {
         $currentOrderUpdateDate = $orderData['purchase_update_date'];
         if (strtotime($currentOrderUpdateDate) > strtotime($ordersLastSynchronization)) {
             $ordersLastSynchronization = $currentOrderUpdateDate;
         }
         /** @var $orderBuilder Ess_M2ePro_Model_Amazon_Order_Builder */
         $orderBuilder = Mage::getModel('M2ePro/Amazon_Order_Builder');
         $orderBuilder->initialize($account, $orderData);
         $order = $orderBuilder->process();
         if (!$order) {
             continue;
         }
         $orders[] = $order;
     }
     $amazonAccount->setData('orders_last_synchronization', $ordersLastSynchronization)->save();
     return $orders;
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:23,代码来源:Responser.php

示例8: updateReceivedTitles

 private function updateReceivedTitles(array $responseData, Ess_M2ePro_Model_Account $account)
 {
     if (!isset($responseData['items']) || !is_array($responseData['items'])) {
         return;
     }
     /** @var $connWrite Varien_Db_Adapter_Pdo_Mysql */
     $connWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
     $bloTable = Mage::getResourceModel('M2ePro/Buy_Listing_Other')->getMainTable();
     $lolTable = Mage::getResourceModel('M2ePro/Listing_Other_Log')->getMainTable();
     /** @var $mappingModel Ess_M2ePro_Model_Buy_Listing_Other_Mapping */
     $mappingModel = Mage::getModel('M2ePro/Buy_Listing_Other_Mapping');
     /** @var $movingModel Ess_M2ePro_Model_Buy_Listing_Other_Moving */
     $movingModel = Mage::getModel('M2ePro/Buy_Listing_Other_Moving');
     $receivedItems = array();
     foreach ($responseData['items'] as $generalId => $title) {
         if (isset($receivedItems[$generalId]) || empty($title)) {
             continue;
         }
         $receivedItems[$generalId] = $title;
         $listingsOthersWithEmptyTitles = array();
         if ($account->getChildObject()->isOtherListingsMappingEnabled()) {
             /** @var $listingOtherCollection Mage_Core_Model_Mysql4_Collection_Abstract */
             $listingOtherCollection = Mage::helper('M2ePro/Component_Buy')->getCollection('Listing_Other')->addFieldToFilter('main_table.account_id', (int) $account->getId())->addFieldToFilter('second_table.general_id', (int) $generalId)->addFieldToFilter('second_table.title', array('null' => true));
             $listingsOthersWithEmptyTitles = $listingOtherCollection->getItems();
         }
         $connWrite->update($bloTable, array('title' => (string) $title), array('general_id = ?' => (int) $generalId));
         $connWrite->update($lolTable, array('title' => (string) $title), array('identifier = ?' => (int) $generalId, 'component_mode = ?' => Ess_M2ePro_Helper_Component_Buy::NICK));
         if (count($listingsOthersWithEmptyTitles) > 0) {
             foreach ($listingsOthersWithEmptyTitles as $listingOtherModel) {
                 $listingOtherModel->setData('title', (string) $title);
                 $listingOtherModel->getChildObject()->setData('title', (string) $title);
                 $mappingModel->initialize($account);
                 $mappingResult = $mappingModel->autoMapOtherListingProduct($listingOtherModel);
                 if ($mappingResult) {
                     if (!$account->getChildObject()->isOtherListingsMoveToListingsEnabled()) {
                         continue;
                     }
                     $movingModel->initialize($account);
                     $movingModel->autoMoveOtherListingProduct($listingOtherModel);
                 }
             }
         }
     }
 }
开发者ID:aligent,项目名称:M2E,代码行数:44,代码来源:Title.php

示例9: updateSkusForReceivedItems

 private function updateSkusForReceivedItems($listingOtherCollection, Ess_M2ePro_Model_Account $account, array $items)
 {
     /** @var $mappingModel Ess_M2ePro_Model_Ebay_Listing_Other_Mapping */
     $mappingModel = Mage::getModel('M2ePro/Ebay_Listing_Other_Mapping');
     foreach ($items as $item) {
         foreach ($listingOtherCollection->getItems() as $listingOther) {
             /** @var $listingOther Ess_M2ePro_Model_Listing_Other */
             if ((double) $listingOther->getData('item_id') != $item['id']) {
                 continue;
             }
             $listingOther->getChildObject()->setData('sku', (string) $item['sku'])->save();
             if ($account->getChildObject()->isOtherListingsMappingEnabled()) {
                 $mappingModel->initialize($account);
                 $mappingModel->autoMapOtherListingProduct($listingOther);
             }
             break;
         }
     }
 }
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:19,代码来源:Update.php

示例10: getResponseBody

 private function getResponseBody(Ess_M2ePro_Model_Account $account)
 {
     if ($account->getChildObject()->isFeedbacksAutoResponseCycled()) {
         $lastUsedId = 0;
         if ($account->getChildObject()->getFeedbacksLastUsedId() != null) {
             $lastUsedId = (int) $account->getChildObject()->getFeedbacksLastUsedId();
         }
         $feedbackTemplatesIds = Mage::getModel('M2ePro/Ebay_Feedback_Template')->getCollection()->addFieldToFilter('account_id', $account->getId())->setOrder('id', 'ASC')->getAllIds();
         if (!count($feedbackTemplatesIds)) {
             return '';
         }
         $feedbackTemplate = Mage::getModel('M2ePro/Ebay_Feedback_Template');
         if (max($feedbackTemplatesIds) > $lastUsedId) {
             foreach ($feedbackTemplatesIds as $templateId) {
                 if ($templateId <= $lastUsedId) {
                     continue;
                 }
                 $feedbackTemplate->load($templateId);
                 break;
             }
         } else {
             $feedbackTemplate->load(min($feedbackTemplatesIds));
         }
         if (!$feedbackTemplate->getId()) {
             return '';
         }
         $account->setData('feedbacks_last_used_id', $feedbackTemplate->getId())->save();
         return $feedbackTemplate->getBody();
     }
     if ($account->getChildObject()->isFeedbacksAutoResponseRandom()) {
         $feedbackTemplatesIds = Mage::getModel('M2ePro/Ebay_Feedback_Template')->getCollection()->addFieldToFilter('account_id', $account->getId())->getAllIds();
         if (!count($feedbackTemplatesIds)) {
             return '';
         }
         $index = rand(0, count($feedbackTemplatesIds) - 1);
         $feedbackTemplate = Mage::getModel('M2ePro/Ebay_Feedback_Template')->load($feedbackTemplatesIds[$index]);
         if (!$feedbackTemplate->getId()) {
             return '';
         }
         return $feedbackTemplate->getBody();
     }
     return '';
 }
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:43,代码来源:Response.php

示例11: getUnpaidOrdersUpdates

 private function getUnpaidOrdersUpdates(Ess_M2ePro_Model_Account $account)
 {
     $reservationDays = $account->getChildObject()->getMagentoOrdersReservationDays();
     list($startDate, $endDate) = $this->getDateRangeForUnpaidOrders($reservationDays);
     $ordersIds = Mage::getResourceModel('M2ePro/Ebay_Order')->getCancellationCandidatesChannelIds($account->getId(), $startDate, $endDate);
     if (count($ordersIds) == 0) {
         return array();
     }
     $request = array('orders_ids' => $ordersIds);
     $response = Mage::getModel('M2ePro/Connector_Server_Ebay_Dispatcher')->processVirtualAbstract('sales', 'get', 'orders', $request, NULL, NULL, $account, NULL);
     return isset($response['orders']) ? $response['orders'] : array();
 }
开发者ID:xiaoguizhidao,项目名称:beut,代码行数:12,代码来源:Cancellation.php

示例12: processAccountInventorySku

 private function processAccountInventorySku(Ess_M2ePro_Model_Account $account)
 {
     $this->_profiler->addTitle('Starting account "' . $account->getData('title') . '"');
     /** @var $listingOtherCollection Mage_Core_Model_Mysql4_Collection_Abstract */
     $listingOtherCollection = Mage::helper('M2ePro/Component_Ebay')->getCollection('Listing_Other');
     $listingOtherCollection->addFieldToFilter('`main_table`.account_id', (int) $account->getId());
     $listingOtherCollection->getSelect()->where('`second_table`.`sku` IS NULL');
     $listingOtherCollection->getSelect()->order('second_table.start_date ASC');
     $listingOtherCollection->getSelect()->limit(200);
     if (!$listingOtherCollection->getSize()) {
         $this->_profiler->addEol();
         return;
     }
     /** @var $tempListingOther Ess_M2ePro_Model_Listing_Other */
     $tempListingOther = $listingOtherCollection->getFirstItem();
     $sinceTime = new DateTime($tempListingOther->getData('start_date'), new DateTimeZone('UTC'));
     $sinceTime->modify('-5 minutes');
     $sinceTime = $sinceTime->format('Y-m-d H:i:s');
     $inputData = array('since_time' => $sinceTime, 'getting_inventory_part' => true, 'only_one_page' => true);
     $responseData = Mage::getModel('M2ePro/Connector_Server_Ebay_Dispatcher')->processVirtualAbstract('item', 'get', 'all', $inputData, NULL, NULL, $account->getId(), NULL);
     if (!isset($responseData['items']) || !is_array($responseData['items'])) {
         $this->_profiler->addEol();
         return;
     }
     if (count($responseData['items']) <= 0) {
         foreach ($listingOtherCollection->getItems() as $listingOther) {
             $listingOther->getChildObject()->setData('sku', new Zend_Db_Expr("''"))->save();
         }
         $this->_profiler->addEol();
         return;
     }
     /** @var $mappingModel Ess_M2ePro_Model_Ebay_Listing_Other_Mapping */
     $mappingModel = Mage::getModel('M2ePro/Ebay_Listing_Other_Mapping');
     foreach ($responseData['items'] as $receivedItem) {
         foreach ($listingOtherCollection->getItems() as $listingOther) {
             /** @var $listingOther Ess_M2ePro_Model_Listing_Other */
             if ((double) $listingOther->getData('item_id') != $receivedItem['id']) {
                 continue;
             }
             if ($receivedItem['sku'] == '') {
                 $listingOther->getChildObject()->setData('sku', new Zend_Db_Expr("''"))->save();
             } else {
                 $listingOther->getChildObject()->setData('sku', (string) $receivedItem['sku'])->save();
             }
             if ($account->getChildObject()->isOtherListingsMappingEnabled()) {
                 $mappingModel->initialize($account);
                 $mappingModel->autoMapOtherListingProduct($listingOther);
             }
             break;
         }
     }
     $this->_profiler->addEol();
 }
开发者ID:xiaoguizhidao,项目名称:beut,代码行数:53,代码来源:Update.php

示例13: updateInventoryLinksByPages

 private function updateInventoryLinksByPages(Ess_M2ePro_Model_Account $accountObj, Ess_M2ePro_Model_Marketplace $marketplaceObj)
 {
     // get server data
     $inputData = array('necessary_status' => 2, 'necessary_page' => 1);
     $updateByPagesSettings = $accountObj->getChildObject()->getDecodedListingsUpdateLinksSettings();
     if (!is_null($updateByPagesSettings)) {
         $inputData['necessary_status'] = (int) $updateByPagesSettings['next_status'];
         $inputData['necessary_page'] = (int) $updateByPagesSettings['next_page'];
     }
     $responseData = Mage::getModel('M2ePro/Connector_Server_Play_Dispatcher')->processVirtualAbstract('inventory', 'get', 'pagesProductsLinks', $inputData, NULL, NULL, $accountObj->getId(), NULL);
     if (!isset($responseData['items']) || !is_array($responseData['items'])) {
         return;
     }
     // process and update received data
     $this->updateReceivedLinks($responseData['items']);
     // calculate and save next data
     $nextStatus = (int) $inputData['necessary_status'];
     $nextPage = (int) $inputData['necessary_page'] + (int) $responseData['processed_pages'];
     if ((bool) $responseData['is_last_page']) {
         if ($nextStatus >= 3) {
             $nextPage = 10000;
         } else {
             $nextStatus++;
             $nextPage = 1;
         }
     }
     $updateByPagesSettings = array('next_status' => $nextStatus, 'next_page' => $nextPage);
     $updateByPagesSettings = json_encode($updateByPagesSettings);
     $accountObj->getChildObject()->setData('listings_update_links_settings', $updateByPagesSettings)->save();
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:30,代码来源:GettingProductsLinks.php

示例14: processAccount

 private function processAccount(Ess_M2ePro_Model_Account $account, $percentsForAccount)
 {
     //---------------------------
     $this->_profiler->addEol();
     $this->_profiler->addTitle('Starting account "' . $account->getTitle() . '"');
     // ->__('Task "%s" for eBay account: "%s" is started. Please wait...')
     $status = 'Task "%s" for eBay account: "%s" is started. Please wait...';
     $status = Mage::helper('M2ePro')->__($status, $this->name, $account->getTitle());
     $this->_lockItem->setStatus($status);
     $currentPercent = $this->_lockItem->getPercents();
     //---------------------------
     $collection = Mage::helper('M2ePro/Component_Ebay')->getCollection('Order')->addFieldToFilter('account_id', $account->getId())->addFieldToFilter('reservation_state', Ess_M2ePro_Model_Order_Reserve::STATE_PLACED);
     $reservationDays = (int) $account->getChildObject()->getQtyReservationDays();
     if ($reservationDays > 0) {
         $minReservationStartDate = new DateTime(Mage::helper('M2ePro')->getCurrentGmtDate(), new DateTimeZone('UTC'));
         $minReservationStartDate->modify('- ' . $reservationDays . ' days');
         $minReservationStartDate = $minReservationStartDate->format('Y-m-d H:i');
         $collection->addFieldToFilter('reservation_start_date', array('lteq' => $minReservationStartDate));
     }
     /** @var $reservedOrders Ess_M2ePro_Model_Order[] */
     $reservedOrders = $collection->getItems();
     //---------------------------
     $this->_profiler->addEol();
     $this->_profiler->addTitle('Total orders with expired reservation: ' . count($reservedOrders));
     $currentPercent = $currentPercent + $percentsForAccount * 0.1;
     $this->_lockItem->setPercents($currentPercent);
     $this->_lockItem->activate();
     //---------------------------
     if (count($reservedOrders) == 0) {
         return;
     }
     //---------------------------
     $this->_profiler->addTimePoint(__METHOD__ . 'process' . $account->getId(), 'Release qty for expired reservation');
     $status = 'Task "%s" for eBay account: "%s" is in data processing state. Please wait...';
     $status = Mage::helper('M2ePro')->__($status, $account->getTitle());
     $this->_lockItem->setStatus($status);
     //---------------------------
     $percentPerOrder = ($percentsForAccount - $currentPercent) / count($reservedOrders);
     $tempPercent = 0;
     foreach ($reservedOrders as $order) {
         $order->getReserve()->release();
         $tempPercent += $percentPerOrder;
         if (floor($tempPercent) > 0) {
             $currentPercent += floor($tempPercent);
             $tempPercent -= floor($tempPercent);
             $this->_lockItem->setPercents($currentPercent);
             $this->_lockItem->activate();
         }
     }
     //---------------------------
     $this->_profiler->saveTimePoint(__METHOD__ . 'process' . $account->getId());
     $this->_profiler->addEol();
     $this->_profiler->addTitle('End account "' . $account->getTitle() . '"');
     //---------------------------
 }
开发者ID:technomagegithub,项目名称:magento,代码行数:55,代码来源:Cancellation.php

示例15: saveLastUpdateTime

 private function saveLastUpdateTime(Ess_M2ePro_Model_Account $account, $lastUpdateTime)
 {
     /** @var Ess_M2ePro_Model_Ebay_Account $ebayAccount */
     $ebayAccount = $account->getChildObject();
     $ebayAccount->setData('orders_last_synchronization', $lastUpdateTime)->save();
 }
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:6,代码来源:Receive.php


注:本文中的Ess_M2ePro_Model_Account::getChildObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。