diff options
author | Petr Pchelko <ppchelko@wikimedia.org> | 2021-05-13 13:15:01 -0700 |
---|---|---|
committer | Petr Pchelko <ppchelko@wikimedia.org> | 2021-06-07 07:31:24 -0700 |
commit | d9b3c66dbc28bb8746e223790e48706b50e2a51d (patch) | |
tree | 207ff8dd0791347aa50bb0c95c840c0de0b12c34 /includes/page/PageReferenceValue.php | |
parent | 4450daa310b881095f3f393374cca4a368a9406c (diff) | |
download | mediawikicore-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.php | 11 |
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 |