Ejemplo n.º 1
0
 /**
  * Add field filter to collection
  *
  * @param string|array $field
  * @param string|int|array|null $condition
  * @return \Magento\Cms\Model\ResourceModel\Block\Collection
  */
 public function addFieldToFilter($field, $condition = null)
 {
     if ($field == 'visitor_type') {
         $field = 'customer_id';
         if (is_array($condition) && isset($condition['eq'])) {
             $condition = $condition['eq'] == Visitor::VISITOR_TYPE_CUSTOMER ? ['gt' => 0] : ['null' => true];
         }
     }
     return parent::addFieldToFilter($field, $condition);
 }
Ejemplo n.º 2
0
 /**
  * Initialize dependencies.
  *
  * @param EntityFactory $entityFactory
  * @param Logger $logger
  * @param FetchStrategy $fetchStrategy
  * @param EventManager $eventManager
  * @param string $mainTable
  * @param string $resourceModel
  */
 public function __construct(EntityFactory $entityFactory, Logger $logger, FetchStrategy $fetchStrategy, EventManager $eventManager, $mainTable = 'sales_invoice_grid', $resourceModel = '\\Magento\\Sales\\Model\\ResourceModel\\Order\\Invoice')
 {
     parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
 }
Ejemplo n.º 3
0
 /**
  * Init collection select
  *
  * @return $this
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->addFieldToFilter('class_type', \Magento\Tax\Model\ClassModel::TAX_CLASS_TYPE_PRODUCT);
     return $this;
 }
Ejemplo n.º 4
0
 /**
  * Initialize dependencies.
  *
  * @param EntityFactory $entityFactory
  * @param Logger $logger
  * @param FetchStrategy $fetchStrategy
  * @param EventManager $eventManager
  * @param string $mainTable
  * @param string $resourceModel
  */
 public function __construct(EntityFactory $entityFactory, Logger $logger, FetchStrategy $fetchStrategy, EventManager $eventManager, $mainTable = 'customer_grid_flat', $resourceModel = '\\Magento\\Customer\\Model\\ResourceModel\\Customer')
 {
     parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
 }