1

friends, how to use the walk() method to join two tables in Magento 2 I have 2 tables and I want to join them based on some conditioning. my present code looks like this

    $result = array();
    $model = $this->certificationModel->create()->getCollection()->addFieldToFilter('SKU', array('eq' => $sku));
    foreach ($model->getData() as $key => $value) {
        $isActive = $this->certificateModel->create()->getCollection()->addFieldToFilter('title', array('eq' => $value['Certification']))
            ->addFieldToSelect('status')->getData();
        $certificateId = $this->certificateModel->create()->getCollection()->addFieldToFilter('title', array('eq' => $value['Certification']))
            ->addFieldToSelect('id')->getData();
        if ($isActive[0]['status'] == 1) {
            $result[] = $this->certificateModel->create()->load($certificateId[0]['id'])->getData();
        }
    }
    return $result;

how I can implement walk() here i an using this referance

thanks for help

Your Answer

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

Browse other questions tagged or ask your own question.