本文整理汇总了PHP中Mage_Core_Model_Abstract::getChildren方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::getChildren方法的具体用法?PHP Mage_Core_Model_Abstract::getChildren怎么用?PHP Mage_Core_Model_Abstract::getChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Abstract::getChildren方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeDelete
protected function _beforeDelete(Mage_Core_Model_Abstract $object)
{
foreach ($object->getChildren() as $children) {
$children->delete();
}
return parent::_beforeDelete($object);
}
示例2: getAllChildProductsFromItem
/**
* Get all child products from the quote item.
*
* @param Mage_Core_Model_Abstract
* @return Mage_Catalog_Model_Product[]
*/
protected function getAllChildProductsFromItem(Mage_Core_Model_Abstract $item)
{
/** @var array */
$products = [];
if ($item->getHasChildren()) {
foreach ($item->getChildren() as $childItem) {
/** @var Mage_Catalog_Model_Product */
$product = $childItem->getProduct();
if ($product instanceof Mage_Catalog_Model_Product) {
$products[] = $product;
}
}
}
return $products;
}
示例3: getAllChildSkusFromItem
/**
* Get all child product SKUs from the quote item.
*
* @param Mage_Core_Model_Abstract
* @return array
*/
protected function getAllChildSkusFromItem(Mage_Core_Model_Abstract $item)
{
/** @var array */
$skus = [];
$children = $item->getChildren();
if ($children) {
foreach ($children as $childItem) {
$skus[] = $childItem->getSku();
}
}
return $skus;
}
示例4: getAllChildSkusFromItem
/**
* Get all child product SKUs from the quote item.
*
* @param Mage_Core_Model_Abstract
* @return array
*/
protected function getAllChildSkusFromItem(Mage_Core_Model_Abstract $item)
{
/** @var array */
$skus = [];
$children = $item->getChildren();
if ($children) {
foreach ($children as $childItem) {
/** @var Mage_Catalog_Model_Product */
$product = $childItem->getProduct();
if ($product instanceof Mage_Catalog_Model_Product) {
$skus[] = $product->getSku();
}
}
}
return $skus;
}