/** * Return the number of children that this page ever had, including pages that were deleted */ public function numHistoricalChildren() { $query = Versioned::get_including_deleted_query(ClassInfo::baseDataClass($this->owner->class), "\"ParentID\" = " . (int) $this->owner->ID); return $query->unlimitedRowCount(); }