52 protected function getTranslationUnitPagesByTitle( Title $title, ?
string $code =
null ): array {
53 $dbw = wfGetDB( DB_PRIMARY );
55 $base = $title->getPrefixedDBkey();
57 $baseLength = strlen( $base ) + 1;
59 if ( $code ===
null ) {
60 $like = $dbw->buildLike(
"$base/", $dbw->anyString() );
62 $like = $dbw->buildLike(
"$base/", $dbw->anyString(),
"/$code" );
65 $fields = [
'page_namespace',
'page_title' ];
67 'page_namespace' => NS_TRANSLATIONS,
70 $res = $dbw->select(
'page', $fields, $conds, __METHOD__ );
77 foreach ( $res as $row ) {
78 $title = Title::newFromRow( $row );
83 $key = substr( $handle->getKey(), $baseLength );
84 if ( strpos( $key,
'/' ) !==
false ) {