CMS
Version 3.9
help_book.inc
Go to the documentation of this file.
1
<?php
7
/**************************************************************
8
9
Copyright (c) 2010 Sonjara, Inc
10
11
Permission is hereby granted, free of charge, to any person
12
obtaining a copy of this software and associated documentation
13
files (the "Software"), to deal in the Software without
14
restriction, including without limitation the rights to use,
15
copy, modify, merge, publish, distribute, sublicense, and/or sell
16
copies of the Software, and to permit persons to whom the
17
Software is furnished to do so, subject to the following
18
conditions:
19
20
The above copyright notice and this permission notice shall be
21
included in all copies or substantial portions of the Software.
22
23
Except as contained in this notice, the name(s) of the above
24
copyright holders shall not be used in advertising or otherwise
25
to promote the sale, use or other dealings in this Software
26
without prior written authorization.
27
28
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
30
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
32
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
33
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
34
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
35
OTHER DEALINGS IN THE SOFTWARE.
36
37
*****************************************************************/
38
39
class
HelpBook
extends
DataItem
40
{
41
// Fields
42
var
$fields
= array(
"help_book_id"
=> Number,
43
"title"
=> String,
44
"identifier"
=> String,
45
"description"
=> HTML,
46
"searchable"
=> Boolean,
47
"remote"
=> Boolean,
48
"url"
=> String,
49
"additional_css_files"
=> String);
50
51
var
$relations
= array(
"Pages"
=>
HelpPage
,
52
);
53
54
55
function
Pages
(
$constraint
=
"ORDER BY sort_order"
)
56
{
57
return
$this->getRelatedList(
HelpPage
,
""
,
$constraint
);
58
}
59
60
static
function
findByIdentifier
(
$identifier
)
61
{
62
return
Query::create(
HelpBook
,
"WHERE identifier=:id"
)
63
->bind(
":id"
,
$identifier
)
64
->executeSingle();
65
}
66
67
function
findPage
(
$identifier
)
68
{
69
$pages
= Query::create(
HelpPage
,
"WHERE help_book_id=:book_id AND identifier=:id"
)
70
->bind(
":book_id"
, $this->
help_book_id
,
":id"
,
$identifier
)
71
->execute();
72
73
if
(count(
$pages
) > 0)
return
$pages
[0];
74
75
return
null
;
76
}
77
78
function
HelpBook
()
79
{
80
$this->table =
"help_book"
;
81
$this->primary_key =
"help_book_id"
;
82
83
$this->DataItem(func_get_args());
84
}
85
}
86
?>
$constraint
$constraint
Definition:
activity_report.inc:13
HelpBook
Definition:
help_book.inc:40
HelpBook\$relations
$relations
Definition:
help_book.inc:51
HelpBook\findByIdentifier
static findByIdentifier($identifier)
Definition:
help_book.inc:60
HelpBook\Pages
Pages($constraint="ORDER BY sort_order")
Definition:
help_book.inc:55
HelpBook\HelpBook
HelpBook()
Definition:
help_book.inc:78
HelpBook\$fields
$fields
Definition:
help_book.inc:42
HelpBook\findPage
findPage($identifier)
Definition:
help_book.inc:67
HelpPage
Definition:
help_page.inc:40
help_book_id
$helpPage help_book_id
Definition:
help_page_form.inc:66
$pages
$pages
Definition:
export.inc:38
$identifier
$identifier
Definition:
rss.inc:37
code
cms.sonjara.com
cms
components
online_help
datamodel
help_book.inc
Generated on Tue Mar 23 2021 15:36:13 for CMS by
1.9.1