/**
  * Prepare collection
  *
  * @return \Magento\Backend\Block\Widget\Grid
  */
 protected function _prepareCollection()
 {
     $collection = $this->_collectionFactory->create();
     /* @var $collection \Magentostudy\News\Model\Resource\News\Grid\Collection */
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 2
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_userRolesFactory->create();
     $collection->setRolesFilter();
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 3
0
 /**
  * Prepare rules collection
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->ruleFactory->create()->getResourceCollection();
     $this->setCollection($collection);
     $this->_eventManager->dispatch('adminhtml_block_promo_widget_chooser_prepare_collection', ['collection' => $collection]);
     return parent::_prepareCollection();
 }
Exemplo n.º 4
0
 /**
  * Prepare collection for grid
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     /** @var \Magento\Paypal\Model\ResourceModel\Billing\Agreement\Collection $collection */
     $collection = $this->_agreementFactory->create()->addCustomerDetails();
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 5
0
 /**
  * Apply sorting and filtering to reports review collection
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_reviewsFactory->create()->addProductFilter((int) $this->getRequest()->getParam('id'));
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 6
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     /** @var $collection \Magento\Newsletter\Model\Resource\Queue\Collection */
     $collection = $this->_collectionFactory->create()->addTemplateInfo()->addSubscriberFilter($this->_coreRegistry->registry('subscriber')->getId());
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 7
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     parent::_prepareCollection();
     $collection = $this->_sliderFactory->getCollection();
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 8
0
 /**
  * @return \Magento\Backend\Block\Widget\Grid
  */
 protected function _prepareCollection()
 {
     $collection = $this->_collectionFactory->create();
     $collection->getEntity()->setStore(0);
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 9
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_collection;
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 10
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_modelSampledata->create()->getCollection();
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 11
0
 protected function _prepareCollection()
 {
     $collection = $this->_bannerCollectionFactory->create()->setStoreViewId(null);
     $collection->setIsLoadSliderTitle(TRUE);
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 12
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_blogPostFactory->create()->getCollection();
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 13
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_productsFactory->create()->addAttributeToSelect('entity_id')->addAttributeToSelect('name')->addWishlistCount();
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 14
0
 /**
  * @return $this
  */
 public function _prepareCollection()
 {
     $collection = $this->rulesFactory->create();
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 15
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->categoryCollectionFactory->create();
     $collection = $collection->addAttributeToSelect('*');
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 16
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $id = $this->getRequest()->getParam('group_id');
     $collection = $this->_elementsFactory->create()->getCollection()->addFieldToFilter('group_id', $id);
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 17
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_automationFactory->create();
     $this->setCollection($collection);
     $this->setDefaultSort('updated_at');
     $this->setDefaultDir('DESC');
     return parent::_prepareCollection();
 }
Exemplo n.º 18
0
 protected function _prepareCollection()
 {
     $storeViewId = $this->getRequest()->getParam('store');
     /** @var \Magestore\Bannerslider\Model\ResourceModel\Banner\Collection $collection */
     $collection = $this->_bannerCollectionFactory->create()->setStoreViewId($storeViewId);
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 19
0
 protected function _prepareCollection()
 {
     /** @var $collection \Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate\Collection */
     $collection = $this->_collectionFactory->create();
     $collection->setConditionFilter($this->getConditionName())->setWebsiteFilter($this->getWebsiteId());
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 20
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_teamFactory->create()->getCollection();
     $this->setCollection($collection);
     //echo '<pre>';print_r($collection->getData());exit;
     return parent::_prepareCollection();
     //return $this;
 }
Exemplo n.º 21
0
 /**
  * Prepare collection
  *
  * @return \Magento\Backend\Block\Widget\Grid
  */
 protected function _prepareCollection()
 {
     $collection = $this->_collectionFactory->create();
     /* @var $collection \Magento\Cms\Model\ResourceModel\Page\Collection */
     $collection->setFirstStoreFlag(true);
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 22
0
 protected function _prepareCollection()
 {
     $profile = $this->_coreRegistry->registry('subscription_profile_model');
     $orderId = $profile->getOrderId();
     $collection = $this->_orderFactory->create()->getCollection()->addFieldToFilter('entity_id', $orderId);
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 23
0
 /**
  * Prepare grid collection object
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_paymentCollection->create();
     $this->setCollection($collection);
     if (!$this->getParam($this->getVarNameSort())) {
         $collection->setOrder('payment_id', 'desc');
     }
     return parent::_prepareCollection();
 }
Exemplo n.º 24
0
 /**
  * Prepare grid collection object
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_collectionFactory->create();
     $store = $this->_storeManager->getStore($this->getRequest()->getParam('store'));
     $collection->addStoreFilter($store->getId());
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }
Exemplo n.º 25
0
 /**
  * Prepare collection for grid
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $priceRule = $this->_coreRegistry->registry(\Magento\SalesRule\Model\RegistryConstants::CURRENT_SALES_RULE);
     /**
      * @var \Magento\SalesRule\Model\ResourceModel\Coupon\Collection $collection
      */
     $collection = $this->_salesRuleCoupon->create()->addRuleToFilter($priceRule)->addGeneratedCouponsFilter();
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 26
0
 protected function _prepareCollection()
 {
     $coreSlider = $this->_bannersliderHelper->getCoreSlider();
     $collection = $this->_collectionFactory->create();
     foreach ($coreSlider as $slider) {
         $collection->addItem($this->_objectFactory->create(['data' => ['id' => $slider['value'], 'title' => $slider['label']]]));
     }
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 27
0
 /**
  * Apply sorting and filtering to collection
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_productFactory->create()->getCollection()->setOrder('id')->addAttributeToSelect('name')->addAttributeToSelect('sku')->addAttributeToSelect('price')->addAttributeToSelect('attribute_set_id')->addAttributeToFilter('entity_id', ['nin' => $this->_getSelectedProducts()])->addAttributeToFilter('type_id', ['in' => $this->getAllowedSelectionTypes()])->addFilterByRequiredOptions()->addStoreFilter(\Magento\Store\Model\Store::DEFAULT_STORE_ID);
     if ($this->getFirstShow()) {
         $collection->addIdFilter('-1');
         $this->setEmptyText(__('Please enter search conditions to view products.'));
     }
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 28
0
 /**
  * Prepare collection for grid
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $priceRule = $this->_coreRegistry->registry('current_promo_quote_rule');
     /**
      * @var \Magento\SalesRule\Model\ResourceModel\Coupon\Collection $collection
      */
     $collection = $this->_salesRuleCoupon->create()->addRuleToFilter($priceRule)->addGeneratedCouponsFilter();
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 29
0
 /**
  * Prepare collection for grid
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_collectionFactory->create();
     foreach ($this->getTransactionAdditionalInfo() as $key => $value) {
         $data = new \Magento\Framework\DataObject(['key' => $key, 'value' => $value]);
         $collection->addItem($data);
     }
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Exemplo n.º 30
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_collection;
     if ($this->getCelebrosOnly()) {
         $collection->addFieldToFilter('job_code', 'celebros_export');
     }
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }