ids
in package
Provides an interface to interact with page ids.
Table of Contents
- clear() : mixed
- Clears the id index completely.
- deletepagename() : mixed
- Removes the given page name from the id index.
- getid() : int
- Gets the page id associated with the given page name.
- getpagename() : string
- Gets the page name associated with the given page id.
- movepagename() : mixed
- Moves a page in the id index from $oldpagename to $newpagename.
Methods
clear()
Clears the id index completely.
public
static clear() : mixed
Will break the inverted search index! Make sure you rebuild the search index (if the search module is installed, of course) if you want search to still work. Of course, note that will re-add all the pages to the id index.
Return values
mixed —deletepagename()
Removes the given page name from the id index.
public
static deletepagename(string $pagename) : mixed
Note that this function doesn't handle multiple entries with the same name. Also note that it may get re-added during a search reindex if the page still exists.
Parameters
- $pagename : string
-
The page name to delete from the id index.
Return values
mixed —getid()
Gets the page id associated with the given page name.
public
static getid(string $pagename) : int
If it doesn't exist in the id index, it will be added.
Parameters
- $pagename : string
-
The name of the page to fetch the id for.
Return values
int —The id for the specified page name.
getpagename()
Gets the page name associated with the given page id.
public
static getpagename(int $id) : string
Be warned that if the id index is cleared (e.g. when the search index is rebuilt from scratch), the id associated with a page name may change!
Parameters
- $id : int
-
The id to fetch the page name for.
Return values
string —The page name currently associated with the specified id.
movepagename()
Moves a page in the id index from $oldpagename to $newpagename.
public
static movepagename(string $oldpagename, string $newpagename) : mixed
Note that this function doesn't perform any special checks to make sure that the destination name doesn't already exist.
Parameters
- $oldpagename : string
-
The old page name to move.
- $newpagename : string
-
The new page name to move the old page name to.