Closed Pablossoo closed 4 years ago
Have you registered the service? Can xou share some of your implementation?
No, I don't registered it as service because I found in documentation, information, that if we using autowire we dont have to nothing do.
my constructor in controller
/**
* BookController constructor.
* @param UsersProjection $userProjection
* @param UsersRepository $userRepository
*/
public function __construct(CommandBus $tacticna,UsersProjection $userProjection, UsersRepository $userRepository)
{
$this->userProjection = $userProjection;
$this->userRepository = $userRepository;
$this->tac = $tacticna;
}
And have you added the bundle to the bundles.php bundle registration file ?
Oh, now working, but why I have to register in bundles.php.. if symfony has flex ?
from doc
In a default Symfony application that uses Symfony Flex, bundles are enabled/disabled automatically for you when installing/removing them, so you don't need to look at or edit this bundles.php file.
Have you been updating from older version of symfony? Maybe you don’t have flex configured properly, check out https://symfony.com/doc/current/setup/flex.html . Perhaps your index file isn’t updated etc.
Ok, I fixed it.
I have one more question. How I can automatically mapping command to handler witchout declare in service.yml each handler? I can't find solution to auto mapping.
@pablosso we’re using DI fileLoader and Definition to automatically register services as non public, with autoconfiguration and autowiring enabled. You could probably also make use of the automatic service loading with resource within your config file.
I Should using HandlerMapping interface? Can you show me any example?
Closed due to inactivity.
Hello, I was Installed your bundle, but I have problem with run command bus.. I Using autowiring, and this bundle throw me
$commandBus" of method "__construct()" references class "League\Tactician\CommandBus" but no such service exists. i
How do fix it>?