CMS  Version 3.9
HelpPage Class Reference

Inherits DataItem.

Public Member Functions

 HelpBook ()
 
 Parent ()
 
 Children ($constraint="ORDER BY sort_order, title")
 
 isChildOf ($helpPage)
 Whether this page is a child of the given page. More...
 
 HelpPage ()
 

Public Attributes

 $fields
 
 $relations
 

Detailed Description

Definition at line 39 of file help_page.inc.

Member Function Documentation

◆ Children()

HelpPage::Children (   $constraint = "ORDER BY sort_ordertitle")

Definition at line 68 of file help_page.inc.

69  {
70  return Query::create(HelpPage, "WHERE parent_id=:id $constraint")
71  ->bind(":id", $this->help_page_id)
72  ->execute();
73  }

◆ HelpBook()

HelpPage::HelpBook ( )

Definition at line 56 of file help_page.inc.

57  {
58  return $this->getRelated(HelpBook);
59  }

◆ HelpPage()

HelpPage::HelpPage ( )

Definition at line 97 of file help_page.inc.

98  {
99  $this->table = "help_page";
100  $this->primary_key = "help_page_id";
101 
102  $this->DataItem(func_get_args());
103  }

◆ isChildOf()

HelpPage::isChildOf (   $helpPage)

Whether this page is a child of the given page.

Parameters
obj$helpPage

Definition at line 80 of file help_page.inc.

81  {
82  $child = false;
83  $currPage = clone $this;
84  // walk up the tree to get all parents of the page
85  while(isset($currPage) && !$child)
86  {
87  $currPage = $currPage->Parent();
88  if($currPage->identifier == $helpPage->identifier)
89  {
90  $child = true;
91  }
92  }
93 
94  return $child;
95  }
$helpPage

◆ Parent()

HelpPage::Parent ( )

Definition at line 61 of file help_page.inc.

62  {
63  if (!$this->parent_id) return null;
64 
65  return $this->getRelated(HelpPage, "parent_id");
66  }

Member Data Documentation

◆ $fields

HelpPage::$fields
Initial value:
= array("help_page_id" => Number,
"help_book_id" => Number,
"parent_id" => Number,
"title" => String,
"identifier" => String,
"content" => HTML,
"sort_order" => Number,
"public" => Boolean)

Definition at line 42 of file help_page.inc.

◆ $relations

HelpPage::$relations
Initial value:
= array("HelpBook" => HelpBook,
"Parent" => HelpPage,
"Children" => HelpPage)

Definition at line 51 of file help_page.inc.


The documentation for this class was generated from the following file: