-1

When I tried to logout, it's showing one error.

Fatal error: Interface 'Webkul\Marketplace\Api\ControllersRepositoryInterface' not found in /home/myusername/public_html/app/code/Webkul/Marketplace/Model/ControllersRepository.php on line 21

My website is Depoto

My ControllersRepository.php is as follows:

<?php
/**
 * Webkul Software.
 *
 * @category  Webkul
 * @package   Webkul_Marketplace
 * @author    Webkul
 * @copyright Copyright (c) Webkul Software Private Limited (https://webkul.com)
 * @license   https://store.webkul.com/license.html
 */
namespace Webkul\Marketplace\Model;

use Magento\Framework\Exception\NoSuchEntityException;
use Webkul\Marketplace\Model\ResourceModel\Controllers\CollectionFactory;

/** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyFields) */
class ControllersRepository implements \Webkul\Marketplace\Api\ControllersRepositoryInterface
{
    /**     * @var ControllersFactory */
    protected $_controllersFactory;

    /**     * @var Controllers[] */
    protected $_instancesById = [];

    /**     * @var CollectionFactory */
    protected $_collectionFactory;

    /**     * @param ControllersFactory $controllersFactory * @param CollectionFactory     $collectionFactory */
    public function __construct(ControllersFactory $controllersFactory, CollectionFactory $collectionFactory)
    {
        $this->_controllersFactory = $controllersFactory;
        $this->_collectionFactory = $collectionFactory;
    }

    /**     * {@inheritdoc} */
    public function getById($controllersId)
    {
        $controllersData = $this->_controllersFactory->create();
        /* @var \Webkul\Marketplace\Model\ResourceModel\Controllers\Collection $controllersData */
        $controllersData->load($controllersId);
        if (!$controllersData->getId()) {           // seller controller does not exist           //throw new NoSuchEntityException(__('Requested controller doesn\'t exist'));            $this->_instancesById[$controllersId] = $controllersData;        }      $this->_instancesById[$controllersId] = $controllersData;
            return $this->_instancesById[$controllersId];
        }
    }

    /**     * {@inheritdoc} */
    public function getByModuleName(
        $moduleName = null
    ) {
        $controllersCollection = $this->_collectionFactory->create()
            ->addFieldToFilter('module_name', $moduleName);
        $controllersCollection->load();

        return $controllersCollection;
    }

    /**     * {@inheritdoc}
     */
    public function getByPath(
        $controllerPath = null
    ) {
        $controllersCollection = $this->_collectionFactory->create()
            ->addFieldToFilter('controller_path', $controllerPath);
        $controllersCollection->load();

        return $controllersCollection;
    }

    /**
     * {@inheritdoc}
     */
    public function getList()
    {
        /** @var \Webkul\Marketplace\Model\ResourceModel\Controllers\Collection $collection */
        $collection = $this->_collectionFactory->create();
        $collection->load();

        return $collection;
    }
}
3
  • I think "Webkul\Marketplace\Api\ControllersRepositoryInterface.php" file is missing in the module. So please check that file is in your module or not. If that file is missing, then get the file and add the file in your module "Webkul\Marketplace\Api\ControllersRepositoryInterface.php" path. Aug 8, 2019 at 6:30
  • You was missing a closing curly bracket at getById(). Not sure if that was a copy/paste mistake or if it's an issue.
    – Daniel
    Aug 8, 2019 at 6:36
  • 'Webkul\Marketplace\Api\' check with this path file is missing 'ControllersRepositoryInterface.php'. Aug 8, 2019 at 6:45

1 Answer 1

3

I think "Webkul\Marketplace\Api\ControllersRepositoryInterface.php" file is missing in the module.

So please check that file is in your module or not. If that file is missing, then get the file and add the file in your module

"Webkul\Marketplace\Api\ControllersRepositoryInterface.php" path.

After that, run php bin/magento cache:flush command and check.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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