I’ve just been looking for the solution, and wasn’t happy with the accepted solution.
[Edit: though I now know it’s because I was using annotation].
The way I’ve found that works for me is setting nullable:
/**
* @ORM\Column(type="varchar", nullable=true)
*/
private $totaltime = null;