hi i am new user of laminas.
I just installed Doctrine with my Laminas project. I added a database connection and generated my entities in the Application folder (Application\Entity). I added my entities settings to the module.config.php file in the Application folder. I created a new User and everything, including routing, is working fine. However, when I try to fetch all data from my table to view, the screen displays an error: ‘Class ‘Application\Entity\User’ does not exist’.
i can’t find any solution
module
|_Application
|_config
|_Entity
|_src
|_view
|_User
|_config
|_src
|_view
`entities settings : namespace : Application <in Application folder - module.config.php>`
'doctrine' => [
'driver' => [
__NAMESPACE__ . '_driver' => [
'class' => AnnotationDriver::class,
'cache' => 'array',
'paths' => [__DIR__ . '/../Entity']
],
'orm_default' => [
'drivers' => [
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
],
],
],
],
UserManager
namespace : User\Manager
public function listUsers()
{
$query = $this->entityManager->getRepository(User::class)->findAll();
return $query;
}
UserController
namespace : User\Controller
public function listUserAction()
{
$data = $this->usermanager->listUsers();
var_dump($data);
die();
$view = new ViewModel([
'users' => $data
]);
return $view;
}
Entity Folder => Path : Application\Entity