/** * Apply custom filtering * * @return void */ protected function _renderFiltersBefore() { if (!$this->getLoadDefault()) { $this->getSelect()->where('main_table.website_id > ?', 0); } parent::_renderFiltersBefore(); }
/** * Join store relation table if there is store filter * * @return void */ protected function _renderFiltersBefore() { if ($this->getFilter('store')) { $this->getSelect()->join(['store_table' => $this->getTable('magefan_blog_category_store')], 'main_table.category_id = store_table.category_id', []); } parent::_renderFiltersBefore(); }
/** * Join store relation table if there is store filter * * @param string $tableName * @param string $columnName * @return void */ protected function joinStoreRelationTable($tableName, $columnName) { if ($this->getFilter('store')) { $this->getSelect()->join(['store_table' => $this->getTable($tableName)], 'main_table.' . $columnName . ' = store_table.' . $columnName, [])->group('main_table.' . $columnName); } parent::_renderFiltersBefore(); }
/** * Join store relation table if there is store filter * * @return void */ protected function _renderFiltersBefore() { if ($this->getFilter('store_id')) { $this->getSelect()->join(['store_table' => $this->getTable('gemtoo_blog_article_store')], 'main_table.article_id = store_table.article_id', [])->group('main_table.article_id'); } parent::_renderFiltersBefore(); }
/** * Join store relation table if there is store filter * * @return void */ protected function _renderFiltersBefore() { foreach (array('store', 'category') as $key) { if ($this->getFilter($key)) { $this->getSelect()->join([$key . '_table' => $this->getTable('magefan_blog_post_' . $key)], 'main_table.post_id = ' . $key . '_table.post_id', [])->group('main_table.post_id'); } } parent::_renderFiltersBefore(); }
/** * Join store relation table if there is store filter * * @SuppressWarnings(PHPMD.CamelCaseMethodName) */ protected function _renderFiltersBefore() { if ($this->getFilter('store')) { $this->getSelect()->join(['store_table' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)], 'main_table.' . ThesaurusInterface::THESAURUS_ID . ' = store_table.' . ThesaurusInterface::THESAURUS_ID, [])->group('main_table.' . ThesaurusInterface::THESAURUS_ID); } parent::_renderFiltersBefore(); }
/** * Join store relation table if there is store filter * * @return void */ protected function _renderFiltersBefore() { if ($this->getFilter('store_id')) { $this->getSelect()->join(['store_table' => $this->getTable('sample_news_author_store')], 'main_table.author_id = store_table.author_id', [])->group('main_table.author_id'); } parent::_renderFiltersBefore(); }