更新时间:2023-11-19 16:26:22
我认为这些值是 null
然后。你尝试过:
I think those values are null
then. Did you try:
public function __toString()
{
return (string) $this->getType();
}
和
public function __toString()
{
return (string) $this->getContact();
}
当值为 null
将被转换为字符串,你不应该得到这个例外。
That way when value is null
will be casted to string and you should not get this exception.