public function convertToPHPValue($value) { if ($value === null) { return null; } $val = \DateTime::createFromFormat('!' . static::FORMAT, $value); if (!$val) { throw ConversionException::conversionFailed($value, $this->getName()); } return $val; }
public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) { if ($value === null) { return null; } $value = is_resource($value) ? stream_get_contents($value) : $value; $val = unserialize($value); if ($val === false && $value !== 'b:0;') { throw ConversionException::conversionFailed($value, $this->getName()); } return $val; }