I followed Creating a first extension but I'm getting 500 error and:
[Tue Mar 14 09:45:42 2017] [warn] mod_fcgid: stderr: PHP Fatal error:
Call to a member function createQueryForType() on null in /var/typo3_src/typo3_src-6.2.29/typo3/sysext/extbase/Classes/Persistence/Repository.php on line 251
Server PHP 5.6 and Typo3 6.2.29
Repository code:
<?php
namespace MyVendor\MyExt\Domain\Repository;
use \TYPO3\CMS\Extbase\Persistence\Repository;
class UserRepository extends Repository {
public function __construct() {
}
}
Controller action:
public function getOnlineUsersAction() {
$userRepository = GeneralUtility::makeInstance(UserRepository::class);
$users = $userRepository->findAll();
// todo
}