本文整理汇总了PHP中Mage_Adminhtml_Block_Widget_Grid::_prepareCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget_Grid::_prepareCollection方法的具体用法?PHP Mage_Adminhtml_Block_Widget_Grid::_prepareCollection怎么用?PHP Mage_Adminhtml_Block_Widget_Grid::_prepareCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Adminhtml_Block_Widget_Grid
的用法示例。
在下文中一共展示了Mage_Adminhtml_Block_Widget_Grid::_prepareCollection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareCollection
protected function _prepareCollection()
{
$_205d95c001c842f933e3b55fa4e902d5d2fdd0af = Mage::getModel('sublogin/budget')->getCollection();
$_205d95c001c842f933e3b55fa4e902d5d2fdd0af->getSelect()->join(array('sublogin' => $_205d95c001c842f933e3b55fa4e902d5d2fdd0af->getTable('sublogin/sublogin')), 'main_table.sublogin_id = sublogin.id', array('sublogin.email'));
$this->setCollection($_205d95c001c842f933e3b55fa4e902d5d2fdd0af);
return parent::_prepareCollection();
}
示例2: _prepareCollection
/**
* Setting collection to show
*
* @return Mage_Adminhtml_Block_Widget_Grid
*/
protected function _prepareCollection()
{
$collection = Mage::getModel('xmlconnect/queue')->getCollection();
$collection->addFieldToFilter('main_table.status', array('neq' => Mage_XmlConnect_Model_Queue::STATUS_DELETED));
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例3: _prepareCollection
protected function _prepareCollection()
{
$model = Mage::getModel('review/review');
$collection = $model->getProductCollection();
if ($this->getProductId() || $this->getRequest()->getParam('productId', false)) {
$productId = $this->getProductId();
if (!$productId) {
$productId = $this->getRequest()->getParam('productId');
}
$this->setProductId($productId);
$collection->addEntityFilter($this->getProductId());
}
if ($this->getCustomerId() || $this->getRequest()->getParam('customerId', false)) {
$customerId = $this->getCustomerId();
if (!$customerId) {
$customerId = $this->getRequest()->getParam('customerId');
}
$this->setCustomerId($customerId);
$collection->addCustomerFilter($this->getCustomerId());
}
if (Mage::registry('usePendingFilter') === true) {
$collection->addStatusFilter($model->getPendingStatus());
}
$collection->addStoreData();
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例4: _prepareCollection
protected function _prepareCollection()
{
$collection = Mage::getResourceModel('api/role_collection');
$collection->setRolesFilter();
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例5: _prepareCollection
protected function _prepareCollection()
{
//TODO: add full name logic
$collection = Mage::getResourceModel('sales/order_collection')->addAttributeToSelect('increment_id')->addAttributeToSelect('created_at')->addAttributeToSelect('grand_total')->addAttributeToSelect('order_currency_code')->addAttributeToSelect('store_id')->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')->addExpressionAttributeToSelect('billing_name', 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})', array('billing_firstname', 'billing_lastname'))->addExpressionAttributeToSelect('shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})', array('shipping_firstname', 'shipping_lastname'))->addAttributeToFilter('customer_id', Mage::registry('current_customer')->getEntityId());
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例6: _prepareCollection
protected function _prepareCollection()
{
$collection = Mage::getModel('enterprise_giftregistry/item')->getCollection()->addRegistryFilter($this->getEntity()->getId());
$collection->updateItemAttributes();
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例7: _prepareCollection
protected function _prepareCollection()
{
$collection = Mage::getModel('firstdatae4/recurring')->getCollection();
$this->setCollection($collection);
parent::_prepareCollection();
return $this;
}
示例8: _prepareCollection
protected function _prepareCollection()
{
//TODO: add full name logic
$collection = AO::getResourceModel('sales/order_Creditmemo_collection')->addAttributeToSelect('increment_id')->addAttributeToSelect('created_at')->addAttributeToSelect('order_currency_code')->addAttributeToSelect('store_currency_code')->addAttributeToSelect('base_currency_code')->addAttributeToSelect('state')->addAttributeToSelect('grand_total')->addAttributeToSelect('base_grand_total')->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')->addExpressionAttributeToSelect('billing_name', 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})', array('billing_firstname', 'billing_lastname'))->setOrderFilter($this->getOrder());
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例9: _prepareCollection
protected function _prepareCollection()
{
$store = $this->getRequest()->getParam('store');
$collection = Mage::getModel('webforms/fieldsets')->setStoreId($store)->getCollection()->addFilter('webform_id', $this->getRequest()->getParam('id'));
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例10: _prepareCollection
/**
* Preparation of the data that is displayed by the grid.
*
* @return $this
*/
protected function _prepareCollection()
{
/** @var Mage_Cron_Model_Resource_Schedule_Collection $collection */
$collection = Mage::getModel('cron/schedule')->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例11: _prepareCollection
protected function _prepareCollection()
{
// Get collection
//----------------------------
$collection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('name');
//----------------------------
//----------------------------
$collection->getSelect()->distinct();
//----------------------------
// Set filter store
//----------------------------
$store = Mage::app()->getStore((int) $this->listing->getData('store_id'));
if ($store->getId()) {
$collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', NULL, 'inner', $store->getId());
$collection->joinAttribute('thumbnail', 'catalog_product/thumbnail', 'entity_id', NULL, 'left', $store->getId());
} else {
$collection->addAttributeToSelect('thumbnail');
}
//----------------------------
//------------------------------
$productAddIds = (array) json_decode($this->listing->getData('product_add_ids'), true);
$collection->joinTable(array('lp' => 'M2ePro/Listing_Product'), 'product_id=entity_id', array('id' => 'id'), '{{table}}.listing_id=' . (int) $this->listing->getId());
$collection->joinTable(array('elp' => 'M2ePro/Ebay_Listing_Product'), 'listing_product_id=id', array('listing_product_id' => 'listing_product_id'));
$collection->getSelect()->where('lp.id IN (?)', $productAddIds);
//------------------------------
// exit($collection->getSelect()->__toString());
// Set collection to grid
$this->setCollection($collection);
parent::_prepareCollection();
return $this;
}
示例12: _prepareCollection
protected function _prepareCollection()
{
$role = Mage::getSingleton('aitpermissions/role');
$collection = Mage::getResourceModel('reports/quote_collection');
if (version_compare(Mage::getVersion(), '1.6.0.0', '<')) {
$collection->prepareForProductsInCarts()->setSelectCountSqlType(Mage_Reports_Model_Mysql4_Quote_Collection::SELECT_COUNT_SQL_TYPE_CART);
} else {
$collection->prepareForProductsInCarts()->setSelectCountSqlType(Mage_Reports_Model_Resource_Quote_Collection::SELECT_COUNT_SQL_TYPE_CART);
}
if ($role->isPermissionsEnabled()) {
if (!Mage::helper('aitpermissions')->isShowingAllProducts()) {
if ($role->isScopeStore()) {
$collection->getSelect()->joinLeft(array('product_cat' => Mage::getSingleton('core/resource')->getTableName('catalog_category_product')), 'product_cat.product_id = e.entity_id', array());
$collection->getSelect()->where(' product_cat.category_id in (' . join(',', $role->getAllowedCategoryIds()) . ')
or product_cat.category_id IS NULL ');
$collection->getSelect()->distinct(true);
}
if ($role->isScopeWebsite()) {
$collection->addStoreFilter($role->getAllowedStoreviewIds());
}
}
}
$this->setCollection($collection);
return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
}
示例13: _prepareCollection
protected function _prepareCollection()
{
$collection = Mage::getModel('affiliateplus/transaction')->getCollection();
$collection->getSelect()->where('coupon_code = \'\' OR coupon_code IS NULL');
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例14: _prepareCollection
/**
* Get collection from commission table
*
* Return array of data to with seller commission information
*
* @return array
*/
protected function _prepareCollection()
{
$gid = Mage::helper('marketplace')->getGroupId();
$collection = Mage::getResourceModel('customer/customer_collection')->addNameToSelect()->addAttributeToSelect('email')->addAttributeToSelect('created_at')->addAttributeToSelect('group_id')->addFieldToFilter('group_id', $gid);
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例15: _prepareCollection
protected function _prepareCollection()
{
$collection = AO::getResourceModel('reports/product_collection');
$collection->getEntity()->setStore(0);
$this->setCollection($collection);
return parent::_prepareCollection();
}