I am facing one problem I do not know what is a reason of this I add class with location in my project src/ApiMaps/ApiMapBundle with this name space
<?php
namespace ApiMaps\ApiMapService;
class ApiMapService {
private $transport;
public function __construct() {
$this->transport = 'sendmail';
}
// ...
}
when i give in
src/config/service.yml
app.test:
class: ApiMaps\ApiMapService\ApiMapService
arguments: ["@doctrine.orm.entity_manager"]
and when i run it from some other class for example
src/ApiMaps/ApiMapBundle/Command/GetApiCommand.php
class GetApiCommand extends ContainerAwareCommand
{
protected function execute(InputInterface $input, OutputInterface $output)
{
$number = $this->getContainer()->get('app.test');
}
}
it give me error
Fatal error: Class 'ApiMaps\ApiMapService\ApiMapService' not found in D:\xampp\htdocs\ProjectMapApiData\a pp\cache\dev\appDevDebugProjectContainer.php on line 325 [2016-02-01 08:25:20] php.CRITICAL: Fatal Error: Class 'ApiMaps\ApiMapService\ApiMapService' not found {" type":1,"file":"D:\xampp\htdocs\ProjectMapApiData\app\cache\dev\appDevDebugProjectContainer.php"," line":325,"level":-1,"stack":[]}
[Symfony\Component\Debug\Exception\ClassNotFoundException] Attempted to load class "ApiMapService" from namespace "ApiMaps\ApiMapService". Did you forget a "use" statement for another namespace?
Note-- one thing to mention that when i try to make service from the built-in class of symfony2 classes it does not give me such error. I do know where I need to add the namespace of the class which i recently added with my project that it able to know the class...