public function getParentRecords($intId, $strTable)
{
$arrReturn = array();
// Currently supports a nesting-level of 10
$objPages = $this->prepare("SELECT id, @pid:=pid FROM {$strTable} WHERE id=?" . str_repeat(" UNION SELECT id, @pid:=pid FROM {$strTable} WHERE id=@pid", 9))->execute($intId);
while ($objPages->next()) {
$arrReturn[] = $objPages->id;
}
return $arrReturn;
}