Lucas_Werkmeister_WMDE added a comment.

I think I prefer the suggestion to add an accessor of subentities. And I don’t see why it couldn’t work for subentities of subentities. If we change EntityStatementDataUpdaterAdapter::processEntity to this:

	public function processEntity( EntityDocument $entity ) {
		if ( $entity instanceof StatementListProvider ) {
			foreach ( $entity->getStatements() as $statement ) {
				$this->dataUpdater->processStatement( $statement );
			}
		}
		if ( $entity instanceof SubEntitiesProvider ) {
			foreach ( $entity->getEntities() as $entity ) {
				$this->processEntity( $entity );
			}
		}
	}

it should automatically support recursive subentities. (But perhaps that should be a separate adapter, not EntityStatementDataUpdaterAdapter? I’m not familiar with these classes.)


TASK DETAIL
https://phabricator.wikimedia.org/T204066

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, hoo, Ladsgroup, Nikki, Lydia_Pintscher, Lea_Lacroix_WMDE, Nandana, Mringgaard, Lahi, Gq86, GoranSMilovanovic, QZanden, V4switch, LawExplorer, Jonas, Wong128hk, Wikidata-bugs, matthiasmullie, aude, Fabrice_Florin, Darkdadaah, Matanya, Mbch331, Tgr
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to