當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Varien_Data_Collection::getItemByColumnValue方法代碼示例

本文整理匯總了PHP中Varien_Data_Collection::getItemByColumnValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Data_Collection::getItemByColumnValue方法的具體用法?PHP Varien_Data_Collection::getItemByColumnValue怎麽用?PHP Varien_Data_Collection::getItemByColumnValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Varien_Data_Collection的用法示例。


在下文中一共展示了Varien_Data_Collection::getItemByColumnValue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _applyEventToCategory

 /**
  * Apply event to category
  *
  * @param Varien_Data_Tree_Node|Mage_Catalog_Model_Category $category
  * @param Varien_Data_Collection $eventCollection
  * @return Enterprise_CatalogEvent_Model_Observer
  */
 protected function _applyEventToCategory($category, Varien_Data_Collection $eventCollection)
 {
     foreach (array_reverse($this->_parseCategoryPath($category->getPath())) as $categoryId) {
         // Walk through category path, search event for category
         $event = $eventCollection->getItemByColumnValue('category_id', $categoryId);
         if ($event) {
             $category->setEvent($event);
             return $this;
         }
     }
     return $this;
 }
開發者ID:barneydesmond,項目名稱:propitious-octo-tribble,代碼行數:19,代碼來源:Observer.php

示例2: _verifyTrack

 /**
  * Verify that the passed in track number is in the collections of Magento shipment tracks, otherwise logs warning message.
  * @param  Varien_Data_Collection $tracks
  * @param  OrderEvents\ITrackingNumber $trackingNumber
  * @return self
  */
 protected function _verifyTrack(Varien_Data_Collection $tracks, OrderEvents\ITrackingNumber $trackingNumber)
 {
     $number = $trackingNumber->getTrackingNumber();
     $track = $tracks->getItemByColumnValue('track_number', $number);
     if (is_null($track)) {
         $logMessage = "Magento did not add an expected-to-be-shipped Track number ({$number}) to the shipment.";
         $this->_logger->warning($logMessage, $this->_context->getMetaData(__CLASS__));
     }
     return $this;
 }
開發者ID:sirishreddyg,項目名稱:magento-retail-order-management,代碼行數:16,代碼來源:Shipment.php

示例3: _appendToQtyArray

 /**
  * Append a new quantity index to the passed in 'qtys' array when a match Magento
  * order item is found in the pass in items collection.
  * @param  OrderEvents\IOrderItem $orderItem
  * @param  Varien_Data_Collection $items
  * @param  array $qtys
  * @return self
  */
 protected function _appendToQtyArray(OrderEvents\IOrderItem $orderItem, Varien_Data_Collection $items, array $qtys)
 {
     $item = $items->getItemByColumnValue('sku', $orderItem->getItemId());
     if ($item) {
         // Magento only support integer quantity
         $qtys[$item->getItemId()] = (int) $orderItem->getQuantity();
     }
     return $qtys;
 }
開發者ID:sirishreddyg,項目名稱:magento-retail-order-management,代碼行數:17,代碼來源:Creditissued.php


注:本文中的Varien_Data_Collection::getItemByColumnValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。