0

我更新了这个实体,添加了一些字段。

现在我想重新生成getter和setter,但是执行时php bin/console make:entity --regenerate App没有结果;我的实体是listet,但它说“没有变化”。我尝试过使用 --overwrite 选项的事件。

<?php
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity(repositoryClass="App\Repository\ProfessionalRepository")
*/
class Professional
{
/**
 * @ORM\Id()
 * @ORM\GeneratedValue()
 * @ORM\Column(type="integer")
 */
private $id;

/**
 * @ORM\Column(type="string", length=255)
 */
private $nom;


/**
 * @ORM\Column(type="boolean")
 */
private $actiu;

/**
 * @ORM\ManyToOne(targetEntity="Especialitat")
 * @ORM\JoinColumn(referencedColumnName="id")
 */
private $especialitat;

public function getId(): ?int
{
    return $this->id;
}

public function getNom(): ?string
{
    return $this->nom;
}

public function setNom(string $nom): self
{
    $this->nom = $nom;

    return $this;
}

public function getActiu(): ?bool
{
    return $this->actiu;
}

public function setActiu(bool $actiu): self
{
    $this->actiu = $actiu;

    return $this;
}
}

我正在使用 symfony 4.3.8 在以前的版本中,我执行了 'php bin/console dictionary:genetrate:entities App',我不确定我是否可以在 symfony 4 中使用这个命令,无论如何它都不起作用.

我不知道还能尝试什么...

4

1 回答 1

1

我已经解决了每次更改后清除缓存的问题。

php bin/console cache:clear
于 2019-12-01T13:03:43.847 回答