*/ protected function getCarbonClassName(): string { return Carbon::class; } /** * @return string */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { $precision = $fieldDeclaration['precision'] ?: 10; if ($fieldDeclaration['secondPrecision'] ?? false) { $precision = 0; } if ($precision === 10) { $precision = DateTimeDefaultPrecision::get(); } $type = parent::getSQLDeclaration($fieldDeclaration, $platform); if (!$precision) { return $type; } if (str_contains($type, '(')) { return preg_replace('/\(\d+\)/', "($precision)", $type); } [$before, $after] = explode(' ', "$type "); return trim("$before($precision) $after"); } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @return T|null */ public function convertToPHPValue($value, AbstractPlatform $platform) { $class = $this->getCarbonClassName(); if ($value === null || is_a($value, $class)) { return $value; } if ($value instanceof DateTimeInterface) { return $class::instance($value); } $date = null; $error = null; try { $date = $class::parse($value); } catch (Exception $exception) { $error = $exception; } if (!$date) { throw ConversionException::conversionFailedFormat( $value, $this->getName(), 'Y-m-d H:i:s.u or any format supported by '.$class.'::parse()', $error ); } return $date; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @return string|null */ public function convertToDatabaseValue($value, AbstractPlatform $platform) { if ($value === null) { return $value; } if ($value instanceof DateTimeInterface) { return $value->format('Y-m-d H:i:s.u'); } throw ConversionException::conversionFailedInvalidType( $value, $this->getName(), ['null', 'DateTime', 'Carbon'] ); } } __halt_compiler();----SIGNATURE:----WtI6LtTrIsW6ylb6omfX3P8PC/ipG+ytI11dC5rwudZ/n+o6gJ9XrjAryLRS4Mfpf/fK8+GmzZEC3+C9kXqjYgcKDecTcWWTMh8n7zP6KChQtFbodhU9UwOVohpgnJGFYQeffPjNG6WX8tjWXguRUHdTcwc89ULoZdxgLVE0WGdGM0TRKaRfOrSgoErBR/2TCXVZT8wj3+TnmiV+u+N6PzuCBf4wReAR0WJwEVGqGGb0hyZmF0dGvaPnjmodBDjbAYtSCPrqlQYZIQM3mosTFtrR6JWmK8g/F9SzIAaSWdTLBWfnGY+HH17CDxycTn70E7iH5f7Ns38JkxegV/l+rUwtQxpW82eKco8osmHBt7UUXAy2p0xKPB9E2zofqhQBoF1XT4UE//niTnggkJWdzyu3DLQTkUlxX6YS2ZC82g3gnzcarwOgpFr5WDWGMrLrk/cpqayyo14rztTK/cyeO+GtiNsV+9bJ7uBrYjdf4Vt3KvHBx6Bu0TimZnMX8Uz2HJTC8wVpMaD9j02TfeL552rEfDeeyV1OUS7Tov5O2c6nai9dV11+9hxuRnISa4ftceWxFHz5T8UYOQABXlhvbLgjXvOlqKesTw0kaiKnlfHu9syztv+QxgrujQP6BLL9gE6qmTH46Xhgnaj1ivegiYFbgXw4xyBdFRH/J2ZlKVw=----ATTACHMENT:----ODE4NzQyNDcxNTc2ODQzOCA3ODExMjMzOTg4MDM0Mzk3IDUxNjk3NzQ3Mjk3NDgzNTM=