0
<?php

namespace Identixweb\Requestquote\Block\Requestquote;
use Identixweb\Requestquote\Block\BaseBlock; 
class Quote extends \Magento\Framework\View\Element\Template
{    
    protected $_quoteCollectionFactory;
    protected $_assetRepo;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,        
        \Identixweb\Requestquote\Model\ResourceModel\Quote\CollectionFactory $quoteCollectionFactory, 
        \Magento\Framework\View\Asset\Repository $assetRepo,       
        array $data = []
    )
    {    
        $this->_quoteCollectionFactory = $quoteCollectionFactory; 
        $this->_assetRepo = $assetRepo; 
        parent::__construct($context, $data);
    }

    public function getRequestCollection(){
       $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
       $customerSession = $objectManager->get('Magento\Customer\Model\Session');  
      if($customerSession->isLoggedIn()) {
        $customerId = $customerSession->getCustomer()->getId();
        $collection = $this->_quoteCollectionFactory->create();
        $collection->addFieldToSelect('*');
        $collection->addFieldToFilter('user_id',$customerId);
        $collection->setOrder('id', 'DESC');
        return $collection;
     }
   }

}
  • 1
    Remove \Magento\Framework\View\Asset\Repository $assetRepo and get Repository using $context->getAssetRepository(); – Emipro Technologies Pvt. Ltd. Jul 10 '17 at 5:34
  • @ Emipro Technologies Pvt. Ltd. Thanks for your answer it is solve my problem. i'll appriciate this....!! – Sanjay Gohil Jul 10 '17 at 6:51
0

Remove \Magento\Framework\View\Asset\Repository $assetRepo, from __construct argument and inside __construct replace $this->_assetRepo = $assetRepo; with $this->_assetRepo = $context->getAssetRepository();

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.