Here I don't want to use a object manager.
Below code give me result as i aspect.but I don't want to use a object manager.
I don't known how to convert into factory method.can any one me out.
Here is my code.
<?php
$id= 12; // product id
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->create("Magento\Catalog\Model\Product")->load($id);
$rating = $objectManager->get("Magento\Review\Model\ResourceModel\Review\CollectionFactory");
$collection = $rating->create()
->addStatusFilter(
\Magento\Review\Model\Review::STATUS_APPROVED
)->addEntityFilter(
'product',
$id
)->setDateOrder();
echo "<pre>";
print_r($collection->getData());
?>