NullPage is a type of Page object returned by many API methods to indicate a non-match.
The simplest way to detect a Null$page->id
property.
If it happens to be 0 then for most practical purposes, you have a NullPage
but there's not much point in calling upon them since they will always be empty.
$item = $pages->get("featured=1");
if(!$item->id) {
// this is a NullPage
}
if($item instanceof NullPage) {
// this is a NullPage
}
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Null
class also inherits all the methods and properties of: Page, WireData and Wire.
Common
Name | Return | Summary | |
---|---|---|---|
Null | int | The id property will always be 0 for a Null |
Additional methods and properties
In addition to the methods and properties above, Null
API reference based on ProcessWire core version 3.0.244