繁体   English   中英

嗨,我有这个错误 require(F:\xampp\htdocs\Neitland\storage\proxies\__CG__AppEntitiesVilless.php): failed to open stream: No such file or directory

[英]Hi, I have this error require(F:\xampp\htdocs\Neitland\storage\proxies\__CG__AppEntitiesVilless.php): failed to open stream: No such file or directory

我有这个错误(要求(F:\ xampp \ htdocs \ Neitland \ storage \ proxies __ CG __ AppEntitiesVilles.php :无法打开stream:没有这样的文件或目录)每次我发出请求从一个不均匀的表中检索数据链接到 Villes.php 实体。 我使用 Laravel-Doctrine ORM。这是实体 Villes.php

/**
* @ORM\Entity()
* @ORM\Table(name="villes")
*/

class Ville
{
    public function __construct()
    {
        $this->createdAt = new Carbon();
    }

    /**
    * @ORM\Id
    * @ORM\GeneratedValue
    * @ORM\Column(type="integer",options={"unsigned"=true})
    */
    private $id;


    /**
     * @ORM\Column(type="string",nullable=false)
     */
    private $libelle;

    /**
    * @ORM\OneToMany(targetEntity="App\Entities\Annonce", mappedBy="ville")
    */
    private $annonces;

    /**
    * @ORM\OneToMany(targetEntity="App\Entities\AgentImmobilier", mappedBy="ville")
    */
    private $agents;

    /**
    * @ORM\OneToMany(targetEntity="App\Entities\Notaire", mappedBy="ville")
    */
    private $notaires;

    /**
    * @ORM\OneToMany(targetEntity="App\Entities\Geometre", mappedBy="ville")
    */
    private $geometres;

    /**
    * @ORM\Column(type="datetime",nullable=false)
    */
    private $createdAt;

    /**
    * Get the value of id
    */
    public function getId()
    {
        return $this->id;
    }

    /**
    * Set the value of id
    *
    * @return  self
    */
    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

    /**
    * Get the value of libelle
    */
    public function getLibelle()
    {
        return $this->libelle;
    }

    /**
    * Set the value of libelle
    *
    * @return  self
    */
    public function setLibelle($libelle)
    {
        $this->libelle = $libelle;
        return $this;
    }

    /**
    * Get the value of annonces
    */
    public function getAnnonces()
    {
        return $this->annonces;
    }

    /**
    * Set the value of annonces
    *
    * @return  self
    */
    public function setAnnonces($annonces)
    {
        $this->annonces = $annonces;
        return $this;
    }

    /**
    * Get the value of agents
    */
    public function getAgents()
    {
        return $this->agents;
    }

    /**
    * Set the value of agents
    *
    * @return  self
    */
    public function setAgents($agents)
    {
        $this->agents = $agents;
        return $this;
    }

    /**
    * Get the value of geometres
    */
    public function getGeometres()
    {
        return $this->geometres;
    }

    /**
    * Set the value of geometres
    *
    * @return  self
    */
    public function setGeometres($geometres)
    {
        $this->geometres = $geometres;
        return $this;
    }

    /**
    * Get the value of notaires
    */
    public function getNotaires()
    {
        return $this->notaires;
    }

    /**
    * Set the value of notaires
    *
    * @return  self
    */
    public function setNotaires($notaires)
    {
        $this->notaires = $notaires;
        return $this;
    }

    /**
     * Get the value of createdAt
    */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
    * Set the value of createdAt
    *
    * @return  self
    */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;
        return $this;
    }
}

这是查询

public function geoPost()
{
    $qb = $this->_em->createQueryBuilder()
        ->select('p', 'u')
        ->from('App\Entities\Post', 'p')
        ->innerJoin('p.user', 'u')
        ->where('u.profil = :profil')
        ->setParameter('profil', 'geometre')
        ->getQuery()
        ->getResult();

    return $qb;
}

表 Post.php 和 User.php 未链接到 Villes.php

添加到.env

DOCTRINE_PROXY_AUTOGENERATE=true

这将自动生成 doctrine 个代理。 如果你想手动完成,你可以使用命令:

php artisan doctrine:generate:proxies

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM