aboutsummaryrefslogtreecommitdiffstats
path: root/includes/page/PageReferenceValue.php
diff options
context:
space:
mode:
authorPetr Pchelko <ppchelko@wikimedia.org>2021-05-13 13:15:01 -0700
committerPetr Pchelko <ppchelko@wikimedia.org>2021-06-07 07:31:24 -0700
commitd9b3c66dbc28bb8746e223790e48706b50e2a51d (patch)
tree207ff8dd0791347aa50bb0c95c840c0de0b12c34 /includes/page/PageReferenceValue.php
parent4450daa310b881095f3f393374cca4a368a9406c (diff)
downloadmediawikicore-d9b3c66dbc28bb8746e223790e48706b50e2a51d.tar.gz
mediawikicore-d9b3c66dbc28bb8746e223790e48706b50e2a51d.zip
Add convenience constructors for PageReference/Identity
Change-Id: Id2433f707ea84ea5a57f427fd606de4b109eef43
Diffstat (limited to 'includes/page/PageReferenceValue.php')
-rw-r--r--includes/page/PageReferenceValue.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/includes/page/PageReferenceValue.php b/includes/page/PageReferenceValue.php
index 5a9032aa12e4..a242c0da3507 100644
--- a/includes/page/PageReferenceValue.php
+++ b/includes/page/PageReferenceValue.php
@@ -74,6 +74,17 @@ class PageReferenceValue implements PageReference {
}
/**
+ * Create PageReference for a local page.
+ *
+ * @param int $namespace
+ * @param string $dbKey
+ * @return PageReferenceValue
+ */
+ public static function localReference( int $namespace, string $dbKey ): self {
+ return new self( $namespace, $dbKey, self::LOCAL );
+ }
+
+ /**
* Get the ID of the wiki provided to the constructor.
*
* @return string|false