Repository navigation
feat: Unity extended values on every model, in post and term meta - #92
Merged
Merged
Conversation
Implements Unity's KeyValueStoreInterface on TsmlGroup, TsmlMeeting, TsmlPosition, TsmlLocation, TsmlIntergroupMeeting and TsmlCommittee, and ValueLookup::findByValue() on their repositories. - ExtendedValueMeta holds the storage format (`unity_kv_<Key>`, case kept), the meta_query clause and the read-back rules, once. - PostMetaExtendedValues keeps the values in post meta, lifted from TsmlMember, which now uses it too. TermMetaExtendedValues does the same in term meta for committees. Both read and write on every call, so values stay out of the immutable snapshots and the caches. - Each findByValue() asks for two matches and answers null unless exactly one carries the value. The post repositories pass posts_per_page, since their defaults set it and get_posts() then ignores numberposts. The committee repository passes number to get_terms(). TsmlMemberFields::EXTENDED_VALUE_META_PREFIX stays, now an alias of ExtendedValueMeta::PREFIX. Needs the Unity release that adds these contracts (2.100.1); the two ship and deploy together.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Unity's extended values on the rest of TSML's models: needs bleedingdeacons/unity#84.
TsmlGroup,TsmlMeeting,TsmlPosition,TsmlLocation,TsmlIntergroupMeetingkeep values in post meta;TsmlCommitteein term meta. Same format as members:unity_kv_<Key>, case kept, read and written on every call.src/ExtendedValues/:ExtendedValueMeta(format,meta_queryclause, read-back rules) and thePostMetaExtendedValues/TermMetaExtendedValuestraits.TsmlMembernow uses the post trait;TsmlMemberFields::EXTENDED_VALUE_META_PREFIXstays as an alias.findByValue()asks for two and answers null unless exactly one carries the value. The post repositories limit withposts_per_page: their defaults set it, soget_posts()would ignorenumberposts. Committees useget_terms()withnumber.Order
Merge and deploy after Unity #84 (released as 2.100.1); TSML's new classes fatal against an older Unity. Releases as 2.2.0 (
feat:).Checks
ci-local tsml-for-unity(PHP 8.4, Docker, against the Unity branch): passed.tests/Unit/ExtendedValuesTest.php: both traits through every model, andfindByValue()through every repository (found, two carriers, empty value, bad key). Existing member tests pass unchanged.