MediaWiki  master
Page\PageLookup Interface Reference

Service interface for looking up infermation about wiki pages. More...

Inheritance diagram for Page\PageLookup:
Collaboration diagram for Page\PageLookup:

Public Member Functions

 getExistingPageByText (string $text, int $defaultNamespace=NS_MAIN, int $queryFlags=self::READ_NORMAL)
 Returns an ExistingPageRecord for a given user provided page name text. More...
 
 getPageById (int $pageId, int $queryFlags=self::READ_NORMAL)
 Returns the PageRecord of the given page. More...
 
 getPageByName (int $namespace, string $dbKey, int $queryFlags=self::READ_NORMAL)
 Returns the PageRecord for the given name and namespace. More...
 
 getPageByReference (PageReference $page, int $queryFlags=self::READ_NORMAL)
 Returns the PageRecord of the given page. More...
 
 getPageByText (string $text, int $defaultNamespace=NS_MAIN, int $queryFlags=self::READ_NORMAL)
 Returns a PageIdentity for a given user provided page name text. More...
 
 getPageForLink (LinkTarget $link, int $queryFlags=self::READ_NORMAL)
 Returns the PageIdentity for the given LinkTarget. More...
 

Additional Inherited Members

- Public Attributes inherited from IDBAccessObject
const READ_NONE = -1
 Constants for object loading bitfield flags (higher => higher QoS) More...
 

Detailed Description

Service interface for looking up infermation about wiki pages.

Since
1.36

Definition at line 14 of file PageLookup.php.

Member Function Documentation

◆ getExistingPageByText()

Page\PageLookup::getExistingPageByText ( string  $text,
int  $defaultNamespace = NS_MAIN,
int  $queryFlags = self::READ_NORMAL 
)

Returns an ExistingPageRecord for a given user provided page name text.

Returns null if the page does not exist or if title is not a valid name of a proper page, e.g if it is a special page, an interwiki link, a relative section line, or simply invalid.

Since
1.37
Parameters
string$text
int$defaultNamespaceNamespace to assume per default (usually NS_MAIN)
int$queryFlags
Returns
ExistingPageRecord|null

Implemented in Page\PageStore.

◆ getPageById()

Page\PageLookup::getPageById ( int  $pageId,
int  $queryFlags = self::READ_NORMAL 
)

Returns the PageRecord of the given page.

Parameters
int$pageId
int$queryFlags
Exceptions
InvalidArgumentExceptionif $pageId is 0 or negative.
Returns
ExistingPageRecord|null The page's PageRecord, or null if the page was not found.

Implemented in Page\PageStore.

◆ getPageByName()

Page\PageLookup::getPageByName ( int  $namespace,
string  $dbKey,
int  $queryFlags = self::READ_NORMAL 
)

Returns the PageRecord for the given name and namespace.

Parameters
int$namespace
string$dbKey
int$queryFlags
Returns
ExistingPageRecord|null The page's PageRecord, or null if the page was not found.
Exceptions
InvalidArgumentExceptionif $namespace is negative or $dbKey is empty.

Implemented in Page\PageStore.

◆ getPageByReference()

Page\PageLookup::getPageByReference ( PageReference  $page,
int  $queryFlags = self::READ_NORMAL 
)

Returns the PageRecord of the given page.

May return $page if that already is a PageRecord.

The PageReference must refer to a proper page - that is, it must not refer to a special page.

Parameters
PageReference$page
int$queryFlags
Returns
ExistingPageRecord|null The page's PageRecord, or null if the page was not found.
Exceptions
InvalidArgumentExceptionif $page does not refer to a proper page.

Implemented in Page\PageStore.

◆ getPageByText()

Page\PageLookup::getPageByText ( string  $text,
int  $defaultNamespace = NS_MAIN,
int  $queryFlags = self::READ_NORMAL 
)

Returns a PageIdentity for a given user provided page name text.

Returns null if the title is not a valid name of a proper page, e.g if it is a special page, an interwiki link, a relative section line, or simply invalid.

Since
1.37
Parameters
string$text
int$defaultNamespaceNamespace to assume per default (usually NS_MAIN)
int$queryFlags
Returns
ProperPageIdentity|null

Implemented in Page\PageStore.

◆ getPageForLink()

Page\PageLookup::getPageForLink ( LinkTarget  $link,
int  $queryFlags = self::READ_NORMAL 
)

Returns the PageIdentity for the given LinkTarget.

The page does not have to exist. Fragments are ignored.

The LinkTarget must refer to a proper page - that is, it must not be a relative section link, an interwiki link, or refer to a special page.

Parameters
LinkTarget$link
int$queryFlags
Exceptions
InvalidArgumentExceptionif $link does not refer to a proper page.
Returns
ProperPageIdentity

Implemented in Page\PageStore.


The documentation for this interface was generated from the following file: