1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Review\Model\ResourceModel\Review\Summary;
- /**
- * Review summery collection
- *
- * @author Magento Core Team <core@magentocommerce.com>
- */
- class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
- {
- /**
- * {@inheritdoc}
- */
- protected function _construct()
- {
- $this->_init(
- \Magento\Review\Model\Review\Summary::class,
- \Magento\Review\Model\ResourceModel\Review\Summary::class
- );
- }
- /**
- * Add entity filter
- *
- * @param int|string $entityId
- * @param int $entityType
- * @return $this
- */
- public function addEntityFilter($entityId, $entityType = 1)
- {
- $this->_select->where('entity_pk_value IN(?)', $entityId)->where('entity_type = ?', $entityType);
- return $this;
- }
- /**
- * Add store filter
- *
- * @param int $storeId
- * @return $this
- */
- public function addStoreFilter($storeId)
- {
- $this->_select->where('store_id = ?', $storeId);
- return $this;
- }
- }
|