SubDistrict::getPage - jcobban/Genealogy GitHub Wiki

$subdistrict->getPage($page)

Up: class SubDistrict

This factory method returns the instance of class Page that represents an individual page under this SubDistrict. It has one parameter:

parameter description
$page the identifier of a page within this enumeration division which evaluates to an integer value.

If the value of $page is valid for this enumeration division this method returns an instance of class Page, otherwise it returns null and adds a warning message to the output.

Given that $subdistrict is an instance of class SubDistrict you can either:

    $page      = $subdistrict->getPage($pagenum);
    if (is_null($page))
        $msg   = "$pagenum is not defined in this SubDistrict. ";

or

    $line      = new Page(array('Census'	=> $subdistrict['census'],
				'District'	=> $subdistrict['distid'],
			        'SubDistrict'	=> $subdistrict['sdid'],
			        'Division'	=> $subdistrict['div'],
	                        'Page'		=> $pagenum));
    if (!$page->isExisting)
        $msg   = "$pagenum is not defined in this SubDistrict. " . $page->getErrors();

Next: $subdistrict->getPrevSearch()