144 \
Magento\Framework\UrlInterface $urlModel,
150 $this->_statusFactory = $statusFactory;
151 $this->_summaryFactory = $summaryFactory;
152 $this->_summaryModFactory = $summaryModFactory;
153 $this->_reviewSummary = $reviewSummary;
155 $this->_urlModel = $urlModel;
176 return $this->productCollectionFactory->create();
186 return $this->_statusFactory->create();
222 $summaryData = $this->_summaryModFactory->create()->setStoreId(
$storeId)->load(
$product->getId());
223 $summary = new \Magento\Framework\DataObject();
224 $summary->setData($summaryData->getData());
225 $product->setRatingSummary($summary);
245 return $this->_urlModel->getUrl(
'review/product/view', [
'id' => $this->getReviewId()]);
258 $this->_urlModel->setScope(
$storeId);
261 return $this->_urlModel->getUrl(
'catalog/product/view', [
'id' =>
$productId]);
274 $errors[] =
__(
'Please enter a review summary.');
278 $errors[] =
__(
'Please enter a nickname.');
282 $errors[] =
__(
'Please enter a review.');
299 return parent::afterDeleteCommit();
312 $entityIds[] =
$item->getEntityId();
315 if (
sizeof($entityIds) == 0) {
319 $summaryData = $this->_summaryFactory->create()
320 ->addEntityFilter($entityIds)
321 ->addStoreFilter($this->_storeManager->getStore()->getId())
325 foreach ($summaryData as $summary) {
326 if ($summary->getEntityPkValue() ==
$item->getEntityId()) {
327 $item->setRatingSummary($summary);
355 return in_array(
$store->getId(), (array) $this->getStores());
368 return $this->
getResource()->getEntityIdByCode($entityCode);
379 if ($this->getEntityPkValue()) {
const ENTITY_CUSTOMER_CODE
getProductUrl($productId, $storeId)
$productCollectionFactory
getEntitySummary($product, $storeId=0)
load($modelId, $field=null)
const ENTITY_CATEGORY_CODE
isAvailableOnStore($store=null)
getEntityIdByCode($entityCode)
const STATUS_NOT_APPROVED
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Review\Model\ResourceModel\Review\Product\CollectionFactory $productFactory, \Magento\Review\Model\ResourceModel\Review\Status\CollectionFactory $statusFactory, \Magento\Review\Model\ResourceModel\Review\Summary\CollectionFactory $summaryFactory, \Magento\Review\Model\Review\SummaryFactory $summaryModFactory, \Magento\Review\Model\Review\Summary $reviewSummary, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $urlModel, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
appendSummary($collection)
static is($value, $classBaseName, array $args=array(), $namespaces=array())
getTotalReviews($entityPkValue, $approvedOnly=false, $storeId=0)
const ENTITY_PRODUCT_CODE