Lucas_Werkmeister_WMDE added a comment.

  Rough sketch with Alaa – here, `DatabaseTermIdsResolver` gets the extra join 
conditions, and `DatabasePropertyTermStore` would call that special method if 
it detects its injected `TermIdsResolver` is a `DatabaseTermIdsResolver`.
  
        // in DatabaseTermIdsResolver
    
        public function resolveGroupedTermConditions( array $groupedWhatevers ) 
{
                foreach ( $groupedWhatevers as $groupedWhatever ) {
                        list ( $tables, $conditions ) = $groupedWhatever;
    
                        $result = $db->select(
                                array_merge( 
                                        [ 'wbt_term_in_lang', 
'wbt_text_in_lang', 'wbt_text' ],
                                        $tables
                                ),
                                [ 'wbtl_id', 'wbtl_type_id', 'wbxl_language', 
'wbx_text' ],
                                array_merge( [
                                        'wbtl_text_in_lang_id=wbxl_id',
                                        'wbxl_text_id=wbx_id',
                                ], $conditions ),
                                __METHOD__
                        );
                        $this->preloadTypes( $result );
                        foreach ( $result as $row ) {
                                foreach ( $groupNamesByTermIds[$row->wbtl_id] 
as $groupName ) {
                                        $this->addResultTerms( 
$groupedTerms[$groupName], $row );
                                }
                        }
                        return $groupedTerms;
                }
        }
    
        // in DatabasePropertyTermStore
    
        $this->resolver->resolveGroupedTermConditions( [
                'P1' => [
                        // extra tables
                        [ 'wbt_property_terms' ],
                        // extra conditions
                        [
                                'wbpt_term_in_lang_id=wbtl_id',
                                'wbpt_property_id' => $numericPropertyIds,
                        ],
                ],
        ] )

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

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

To: hoo, Lucas_Werkmeister_WMDE
Cc: alaa_wmde, Aklapper, Lucas_Werkmeister_WMDE, Daryl-TTMG, RomaAmorRoma, 
E.S.A-Sheild, darthmon_wmde, joker88john, CucyNoiD, Nandana, NebulousIris, 
Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, 
Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, 
Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, WSH1906, 
Lewizho99, Maathavan, _jensen, rosalieper, Wikidata-bugs, aude, 
Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to