conversionFailedFormat example

 $value->format($platform->getDateFormatString()) : null;
    }

    public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if ($value === null) {
            return null;
        }

        $val = DateTime::createFromFormat('!' . $platform->getDateFormatString()$value);
        if (!$val) {
            throw ConversionException::conversionFailedFormat($value$this->getName()$platform->getDateFormatString());
        }

        return $val;
    }
}
 $value->format($platform->getDateTimeFormatString()) : null;
    }

    public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if ($value === null) {
            return null;
        }

        $val = DateTime::createFromFormat($platform->getDateTimeFormatString()$value);
        if (!$val) {
            throw ConversionException::conversionFailedFormat($value$this->getName()$platform->getDateTimeFormatString());
        }

        return $val;
    }
}
Home | Imprint | This part of the site doesn't use cookies.