- $fname = 'LinksUpdate::getExistingCategories';
- $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey' ),
- array( 'cl_from' => $this->mId ), $fname, $this->mOptions );
+ $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey_prefix' ),
+ array( 'cl_from' => $this->mId ), __METHOD__, $this->mOptions );
+ $arr = array();
+ foreach ( $res as $row ) {
+ $arr[$row->cl_to] = $row->cl_sortkey_prefix;
+ }
+ return $arr;
+ }
+
+ /**
+ * Get an array of existing interlanguage links, with the language code in the key and the
+ * title in the value.
+ * @private
+ */
+ function getExistingInterlangs() {
+ $res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ),
+ array( 'll_from' => $this->mId ), __METHOD__, $this->mOptions );
+ $arr = array();
+ foreach ( $res as $row ) {
+ $arr[$row->ll_lang] = $row->ll_title;
+ }
+ return $arr;
+ }
+
+ /**
+ * Get an array of existing inline interwiki links, as a 2-D array
+ * @return array (prefix => array(dbkey => 1))
+ */
+ protected function getExistingInterwikis() {
+ $res = $this->mDb->select( 'iwlinks', array( 'iwl_prefix', 'iwl_title' ),
+ array( 'iwl_from' => $this->mId ), __METHOD__, $this->mOptions );