# \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

File
  core.php
Package
  core
Class hierarchy
  \ids

## Tags

None found

## 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.

#

static

## Tags

package | core

### 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.

#

static

## Tags

package | core

### 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.

#

static

## Tags

package | core

### 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.

#

static

## Tags

package | core

### 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.

#

static

## Tags

package | core

### core.php