本文整理汇总了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;
}
示例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;
}
示例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;
}