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
REP\MyExtension\:
resource: '../Classes/*'
Any ideas?
Thanks