尝试加载类Error Symfony 2

时间:2016-02-24 14:54:03

标签: php symfony

我的问题是,我正在尝试执行命令,但是给我下一个错误:

  

尝试加载类" XMLReport"从命名空间   " BUSINESSNAME \核心\ LibraryDatabaseBundle \库&#34 ;.你是否   忘记"使用"声明   " BUSINESSNAME \核心\ LibraryDatabaseBundle \实体\ XMLReport"

存储库类正在使用命名空间:

namespace Mundoreader\Core\LibraryDatabaseBundle\Repository;

use Doctrine\ORM\Query\QueryException;
use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\QueryBuilder;
use Mundoreader\Core\LibraryDatabaseBundle\Entity\Library;

/**
 * Class XMLReportRepository
 *
 */
class XMLReportRepository extends AbstractRepository
{/*code
}

命令类是:

class GenerateXMLCommand extends AbstractCommand
{

    protected function configure()
    {
        $this
            ->setName('library:reports:generateXML')
            ->setDescription('Generate XML');
    }    
protected function execute(InputInterface $input, OutputInterface $output)
        {
            $statusToDo         = $this->xmlReportRepo->countAllStatusToDo();

            if($statusToDo)
            {

                //XML BBDD
                $emXML          = new XMLReport();
                $libraryXML     = $emXML->getLibrary();
                $isbnXML        = $emXML->getISBN();
                $toDateXML      = $emXML->getReportDateEnd();
                $fromDateXML    = $emXML->getReportDateStart();
                $arrayXMLInfo = array(
                    ['fromDate']    => $fromDateXML,
                    ['toDate']      => $toDateXML,
                    ['library']     => $libraryXML,
                    ['isbn']        => $isbnXML
                );
    /*More Code 
    }

我不知道错误在哪里,因为我在以下地方调用了存储库:

$statusToDo         = $this->xmlReportRepo->countAllStatusToDo();

在extend类中,我有路径:

abstract class AbstractCommand extends ContainerAwareCommand
{
public function setContainer(ContainerInterface $container = null)
    {
        $this->xmlReportRepo = $this->doctrine->getRepository('MrLibraryDatabaseBundle:XMLReport');
    }
}
PD:抱歉我的英语不好。

1 个答案:

答案 0 :(得分:1)

请检查映射定义中的存储库类。应该是这样的:

geometry.faceVertexUvs