📌  相关文章
📜  不允许序列化 'Symfony\Component\HttpFoundation\File\File' - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:25.389000             🧑  作者: Mango

代码示例2
For Vich Uploader
you need to use implements and public function serializable/unserializable.

  class NameEntity implements Serializable
{
  
  //code here 
  
  public function serialize()
    {
        return serialize($this->getId());
    }

    public function unserialize($serialized)
    {
        $this->id = unserialize($serialized);
    }
}

It works for me.