我不知道错误是从哪里来的。一切设置完毕:
trait SoftDeleteable
{
/**
* @var \DateTime
* @ORM\Column(name="deleted", type="datetime", nullable=true)
*/
protected $deleted;
}
在我的实体类中:
use App\Base\Entity\Traits\SoftDeleteable;
/**
* @ORM\Entity
* @ORM\Table(name="user")
* @Gedmo\SoftDeleteable(fieldName="deleted", timeAware=false)
*/
class User extends BaseEntity
{
use SoftDeleteable;
}
和config.yml
中filters:
softdeleteable:
class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
enabled: true
当我尝试更新数据库时,它抛出:
在类“ App \ Base \ Entity \”上未找到字段“ deleted”的映射 t \ User'。