\ids

Provides an interface to interact with page ids.

Summary

Methods
Properties
Constants
getid()
getpagename()
movepagename()
deletepagename()
clear()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getid()

getid(string  $pagename) : integer

Gets the page id associated with the given page name.

If it doesn't exist in the id index, it will be added.

Parameters

string $pagename

The name of the page to fetch the id for.

Returns

integer —

The id for the specified page name.

getpagename()

getpagename(integer  $id) : string

Gets the page name associated with the given page id.

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

integer $id

The id to fetch the page name for.

Returns

string —

The page name currently associated with the specified id.

movepagename()

movepagename(string  $oldpagename, string  $newpagename) 

Moves a page in the id index from $oldpagename to $newpagename.

Note that this function doesn't perform any special checks to make sure that the destination name doesn't already exist.

Parameters

string $oldpagename

The old page name to move.

string $newpagename

The new pagee name to move the old page name to.

deletepagename()

deletepagename(string  $pagename) 

Removes the given page name from the id index.

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

string $pagename

The page name to delete from the id index.

clear()

clear() 

Clears the id index completely.

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.