Page MenuHomePhabricator

Move Serialization/Deserialization from Event to Mapper
Open, Needs TriagePublic

Description

The Event extra array serialization and deserialization live inside the MediaWiki\Extension\Notifications\Model\Event class.

After switching from PHP serialize/unserialize methods to JSON codec now the Event depends on MediaWiki services to retrieve the JSONCodec service. As a model, it shouldn't rely on services.

Events are created via MediaWiki\Extension\Notifications\Mapper\EventMapper - this mapper is responsible for fetching and storing Event data in DB. Therefore it's a better place to serialize/deserialize the extra array.