* @file
* @ingroup Database
*/
+namespace Wikimedia\Rdbms;
+
+use InvalidArgumentException;
/**
* Class to handle database/prefix specification for IDatabase domains
throw new InvalidArgumentException( "Prefix must be a string." );
}
$this->prefix = $prefix;
- $this->equivalentString = $this->convertToString();
}
/**
);
}
- return ( $this->equivalentString === $other );
+ return ( $this->getId() === $other );
}
/**
* @return string
*/
public function getId() {
+ if ( $this->equivalentString === null ) {
+ $this->equivalentString = $this->convertToString();
+ }
+
return $this->equivalentString;
}