本文整理汇总了PHP中Varien_Data_Collection_Db::getNewEmptyItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Collection_Db::getNewEmptyItem方法的具体用法?PHP Varien_Data_Collection_Db::getNewEmptyItem怎么用?PHP Varien_Data_Collection_Db::getNewEmptyItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Collection_Db
的用法示例。
在下文中一共展示了Varien_Data_Collection_Db::getNewEmptyItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addGroupsCatalogFilterToCollection
/**
* Inner join the groupscatalog index table to hide entities not visible to the specified customer group id
*
* @param Varien_Data_Collection_Db $collection
* @param int $groupId The customer group id
* @return void
*/
public function addGroupsCatalogFilterToCollection(Varien_Data_Collection_Db $collection, $groupId)
{
/* @var $helper Netzarbeiter_GroupsCatalog2_Helper_Data */
$helper = Mage::helper('netzarbeiter_groupscatalog2');
/**
* This is slightly complicated but it works with products and
* categories whether the flat tables enabled or not
*
* @var $entityType string
* @var $entity Mage_Catalog_Model_Abstract
*/
$entity = $collection->getNewEmptyItem();
$entityType = $helper->getEntityTypeCodeFromEntity($entity);
$this->_init($helper->getIndexTableByEntityType($entityType), 'id');
if ($this->_doesIndexExists()) {
$filterTable = $collection->getResource()->getTable($helper->getIndexTableByEntityType($entityType));
$entityIdField = "{$this->_getCollectionTableAlias($collection)}.entity_id";
$this->_addGroupsCatalogFilterToSelect($collection->getSelect(), $filterTable, $groupId, $collection->getStoreId(), $entityIdField);
}
}
示例2: getNewEmptyItem
/**
* Retrieve collection empty item
*
* @return Varien_Object
*/
public function getNewEmptyItem()
{
/* @var $item Mzax_Emarketing_Model_Object_Collection_Item */
$item = parent::getNewEmptyItem();
$item->setObject($this->getObject());
return $item;
}