Unable to find table class for current entity error in cakephp 3

812 views Asked by At

In my below code when I am getting complete zero result pr zero rows that time I am getting this error:

Unable to find table class for current entity error

And if any row is coming in the pagination that time everything is working fine. Where I am doing wrong?

    $prProductFind=$this->PurchaseRequisitionProducts
    ->find()
    ->where([$condn,$conditions])
    ->matching('PurchaseOrderProducts', function(\Cake\ORM\Query $q) {
        return $q->where(['PurchaseOrderProducts.id IS NOT NULL']);
    })
    ->matching('PurchaseOrderProducts.PurchaseOrder', function(\Cake\ORM\Query $q) {
        return $q->where(['PurchaseOrder.id IS NOT NULL','PurchaseOrder.is_approve'=>"Y",'PurchaseOrder.po_type'=>1,'PurchaseOrder.status'=>1]);
    })

    ->group(['PurchaseRequisitionProducts.id'])
    ->order(["PurchaseRequisitionProducts.id"=>"desc"]);

       $pr_product = $this->paginate($prProductFind);
0

There are 0 answers