-
I can't figure out how, using the It is possible to do it through the schema, but I don't see such a possibility through attributes. All the examples in the documentation use primitive data types. #[Embeddable]
class Moderation
{
// ok hydration
#[Column(type: 'string', typecast: Status::class, length: 20)]
public Status $status;
// fail hydration
// TypeError: Cannot assign string to property Moderation::$reason of type Reason
#[Column(type: 'text', nullable: true, typecast: ReasonTypecast::NAME)]
public ?Reason $reason; #[Entity(
typecast: [
ReasonTypecast::class, // does not work?
\Cycle\ORM\Parser\Typecast::class,
],
)]
class Draft
{
#[Embedded(target: Moderation::class)]
public Moderation $moderation; |
Beta Was this translation helpful? Give feedback.
Answered by
KorDum
May 13, 2025
Replies: 1 comment 6 replies
-
Looks like a bug. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed in PR