TYPO3 10: Error: Call to a member function findByUid()

I updated the dependency Injection in my Controller, now it looks like this:

class MyExtensionController extends ActionControlelr
{
 /**
 * @ var MyExtensionRepository
 /**
 protected $myRepository
..
..
..

But calling the Repository in the next function like this

public function indexAction()
{
    // get needed info
    /** @var Category $category */
    $category = $this->myRepository->findByUid($this->settings['flexForm']['categoryId']);

returns the error:

Error: Call to a member function findByUid() on null

Services.yaml looks like this:

services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  REPMyExtension:
    resource: '../Classes/*'

Any ideas?

Thanks

Source: Symfony Questions

Was this helpful?

0 / 1

Leave a Reply 0

Your email address will not be published. Required fields are marked *