daniel added a comment. A brief survey how places that have the available entity types hard-coded:
Using Item::ENTITY_TYPE or Property::ENTITY_TYPE: - ItemContent and ItemHandler, resp. PropertyContent and PropertyHandler //(no need to change this)// - WikibaseClient::getEntityFactory, getEntityChangeFactory - WikibaseRepo::getEntityFactory, getEntityChangeFactory, getContentModelMappings - ValidatorBuilders::buildItemValidators - EntityPerPageTable::getItemsWithoutSitelinks //(should probably move to SiteLinksTable)// - EntityConstraintProvider::getUpdateValidators, getCreationValidators - TermValidatorFactory::getFingerprintValidator, getLabelValidator - EntityDiff::newFromType //(move this to ItemHandler etc)// - //...lots of test cases, which are mostly fine// Using CONTENT_MODEL_WIKIBASE_ITEM or CONTENT_MODEL_WIKIBASE_PROPERTY: - ItemContent and ItemHandler, resp. PropertyContent and PropertyHandler //(no need to change this)// - WikibaseRepo::getContentModelMappings - RepoHooks::onContentHandlerForModelID - Wikibase.php entry point: $wgHooks['FormatAutocomments'][] All of the above should use some sort of registry of entity types. The extension point for registering entity types could look like the extension point for data types: a global array, with one entry per entity type, mapping to a set of callback functions for performing type-specific tasks. Alternatively, we could try to push all registration logic into EntityHandler subclasses, and use the ContentHandler registration mechanism as the basis for registering entity types. Schema changes: - If we want Entities other than Items to support sitelinks, the schema of wb_items_per_site needs to change from numeric to prefixed ids. - If we need support for non-numeric IDs, the schema of wb_terms and wb_entity_per_page needs to change from numeric to prefixed ids. TASK DETAIL https://phabricator.wikimedia.org/T75496 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: daniel Cc: Ricordisamoa, Aklapper, adrianheine, GPHemsley, thiemowmde, JeroenDeDauw, JanZerebecki, aude, Lydia_Pintscher, daniel, hoo, Izno, Wikidata-bugs, Mbch331 _______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs