/** @var MagicWordArray */
private $mDoubleUnderscoreArray = null;
+ /** @var Language */
+ private $contLang;
+
/**#@-*/
+ /**
+ * @param Language $contLang Content language
+ */
+ public function __construct( Language $contLang ) {
+ $this->contLang = $contLang;
+ }
+
+ public function getContentLanguage() {
+ return $this->contLang;
+ }
+
/**
* Factory: creates an object representing an ID
*
*/
public function get( $id ) {
if ( !isset( $this->mObjects[$id] ) ) {
- $mw = new MagicWord();
+ $mw = new MagicWord( null, [], false, $this->contLang );
$mw->load( $id );
$this->mObjects[$id] = $mw;
}
public function getDoubleUnderscoreArray() {
if ( is_null( $this->mDoubleUnderscoreArray ) ) {
Hooks::run( 'GetDoubleUnderscoreIDs', [ &$this->mDoubleUnderscoreIDs ] );
- $this->mDoubleUnderscoreArray = new MagicWordArray( $this->mDoubleUnderscoreIDs );
+ $this->mDoubleUnderscoreArray = $this->newArray( $this->mDoubleUnderscoreIDs );
}
return $this->mDoubleUnderscoreArray;
}
+
+ /**
+ * Get a new MagicWordArray with provided $names
+ *
+ * @param array $names
+ * @return MagicWordArray
+ */
+ public function newArray( array $names = [] ) : MagicWordArray {
+ return new MagicWordArray( $names, $this );
+ }
}