In My Case StoreManagerInterface is not Injecting in Custom\Module\Model\ResourceModel\Module\Collection Class and i was passing to StoreManagerInterface to Constructor of Grid COllection which is causing problem when I removed it started working Fine
Magento strictly follows and recommends design patterns
This implementation use to manipulate entity objects but not able to create new one.
$repo = $this->myRepository();
$object = $repo->getById($myId);
This implementation use ...
Works for me
$searchCriteria = $this->searchCriteriaBuilder
$ordersList = $...
here's a shorter version to build the time filter:
// get current time - 1 hour
$time = date(
(time() - 3600)
// then use it as a filter
'gteq' => $time
as for the status filtering, it should be something like this:
For one thing, to be sure you are passing the right args into the function in your file, dont directly enter classnames as strings. Do this, as it is best practice.
Also, the visibility on _construct should be protected. You have public.
class Collection extends \Magento\Framework\Model\...
You need to do an inner join instead of a left join on catelog_category_product table. Picking Method #3 just because, but you should be able to adapt this to whichever one you want.
$_productCollection->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')->addAttributeToFilter('category_id', array('in' =&...