Martijn you can actually do PDO::FETCH_CLASS|PDO::FETCH_PROPS_LATE to fill in properties *after* __construct!
Login or register your account to reply
Mark Dain Oh nice! Although for your usecase of loading into the Item class, you still need to convert to DateTimeImmutable, right? Nice to know though!
5y, 52w 1 reply
Martijn Yes. But I am wondering if conversion on first access (first $instance->created() call) would be an option. Same for the item contents, instead of always reading the flatfile into memory on __construct only do it at first access ($instance->content()).
5y, 52w reply