Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 条令:从数据库生成实体_Php_Mysql_Doctrine - Fatal编程技术网

Php 条令:从数据库生成实体

Php 条令:从数据库生成实体,php,mysql,doctrine,Php,Mysql,Doctrine,我正在使用条令从命令行中的数据库生成实体 orm:从数据库注释转换映射--force--。/Api/实体 php类是正确创建的,但是当我尝试使用存储库从数据库加载实体时 $decompte=$entityManager->getRepository(Decompte::class)->find(31); 我得到了这个例外 Class "entity\Decompte" is not a valid entity or mapped super class. 请在上面找到类实体\D

我正在使用条令从命令行中的数据库生成实体

orm:从数据库注释转换映射--force--。/Api/实体

php类是正确创建的,但是当我尝试使用存储库从数据库加载实体时

$decompte=$entityManager->getRepository(Decompte::class)->find(31);
我得到了这个例外

Class "entity\Decompte" is not a valid entity or mapped super class.
请在上面找到类实体\Decompte的完整代码

<?php

use Doctrine\ORM\Mapping as ORM;

/**
 * Decompte
 *
 * @ORM\Table(name="decompte", indexes={@ORM\Index(name="N°D", columns={"ID"})})
 * @ORM\Entity
 */
class Decompte
{
    /**
     * @var int
     *
     * @ORM\Column(name="ID", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var int|null
     *
     * @ORM\Column(name="NPRIXD", type="integer", nullable=true)
     */
    private $nprixd;

    /**
     * @var string|null
     *
     * @ORM\Column(name="DESIGNATIOND", type="string", length=43, nullable=true)
     */
    private $designationd;

    /**
     * @var string|null
     *
     * @ORM\Column(name="UNITED", type="string", length=2, nullable=true)
     */
    private $united;

    /**
     * @var int|null
     *
     * @ORM\Column(name="QTED", type="integer", nullable=true)
     */
    private $qted;

    /**
     * @var int|null
     *
     * @ORM\Column(name="PRIXHTD", type="integer", nullable=true)
     */
    private $prixhtd;

    /**
     * @var string|null
     *
     * @ORM\Column(name="DECOMPTED", type="string", length=2, nullable=true)
     */
    private $decompted;

    /**
     * @var int|null
     *
     * @ORM\Column(name="TOTALD", type="integer", nullable=true)
     */
    private $totald;

    /**
     * @var string|null
     *
     * @ORM\Column(name="QMARCHE", type="string", length=11, nullable=true)
     */
    private $qmarche;

    /**
     * @var string|null
     *
     * @ORM\Column(name="QDECOMPTE", type="string", length=5, nullable=true)
     */
    private $qdecompte;

    /**
     * @var int|null
     *
     * @ORM\Column(name="SMARCHE", type="integer", nullable=true)
     */
    private $smarche;

    /**
     * @var string|null
     *
     * @ORM\Column(name="SDECOMPTE", type="string", length=6, nullable=true)
     */
    private $sdecompte;

    /**
     * @var int|null
     *
     * @ORM\Column(name="NDMR", type="integer", nullable=true)
     */
    private $ndmr;

    /**
     * @var string|null
     *
     * @ORM\Column(name="RESTE", type="string", length=11, nullable=true)
     */
    private $reste;

    /**
     * @var string|null
     *
     * @ORM\Column(name="RESTEF", type="string", length=11, nullable=true)
     */
    private $restef;


}

非常感谢您的帮助

这可能有助于您好,显示完整的反编译类代码以解决您的问题。检查类上的@ORM\Entity注释谢谢@mamounothman,但我不认为我的问题是相同的,因为我的类定义correct@Aleksandr知道吗?你的索引名看起来很奇怪
 echo 'allClassName'.$this->getAllClassNames();
    echo 'allPaths'.$this->getPaths();
    returns an empty array


$classAnnotations = $this->reader->getClassAnnotations($class);
is also empty