We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having following entity with custom type and descriptor:
enum FeeCategory: string {} #[Entity] class Fee { #[Column(type: FeeCategoryType::NAME] private FeeCategory $feeCategory; } class FeeCategoryType extends StringType { final public const NAME = 'fee_category'; /** * @return class-string<BackedEnum<string>> */ public function getEnumClass(): string { return FeeCategory::class; } public function getName(): string { return self::NAME; } /** * @param BackedEnum<string>|string|null $value * @return BackedEnum<string>|null */ public function convertToPHPValue($value, AbstractPlatform $platform): ?BackedEnum { if ($value instanceof BackedEnum) { return $value; } $value = parent::convertToPHPValue($value, $platform); if ($value === null) { return null; } return static::getEnumClass()::from($value); } /** * @param BackedEnum<string>|string|null $value */ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string { if (!$value instanceof BackedEnum) { return $value; } return $value->value; } public function requiresSQLCommentHint(AbstractPlatform $platform): bool { return true; } } class FeeCategoryTypeDescriptor implements DoctrineTypeDescriptor { public function getType(): string { return FeeCategoryType::class; } public function getWritableToPropertyType(): Type { return new ObjectType(FeeCategory::class); } public function getWritableToDatabaseType(): Type { return new StringType(); } public function getDatabaseInternalType(): Type { return new StringType(); } }
Still produces error
Property Fee::$feeCategory type mapping mismatch: property can contain FeeCategory but database expects string.
I think this rule should utilize the knowledge from the descriptor.
Used version: 1.3.29, bleedingEdge enabled.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Having following entity with custom type and descriptor:
Still produces error
I think this rule should utilize the knowledge from the descriptor.
Used version: 1.3.29, bleedingEdge enabled.
The text was updated successfully, but these errors were encountered: