Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
Class.DocAttr.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @package FDL
5
*/
6
/**
7
* Generated Header (not documented yet)
8
*
9
* @author Anakeen
10
* @version $Id: Class.DocAttr.php,v 1.24 2007/02/27 10:05:17 eric Exp $
11
* @package FDL
12
*/
13
/**
14
*/
15
include_once (
'Class.DbObj.php'
);
16
include_once (
'Class.QueryDb.php'
);
17
include_once (
'Class.Log.php'
);
18
/**
19
* Database Attribute document
20
* @package FDL
21
*
22
*/
23
class
DocAttr
extends
DbObj
24
{
25
var
$fields
= array(
26
"id"
,
27
"docid"
,
28
"frameid"
,
29
"labeltext"
,
30
"title"
,
31
"abstract"
,
32
"type"
,
33
"ordered"
,
34
"visibility"
,
// W, R, H, O, M, C
35
"needed"
,
36
"link"
,
37
"phpfile"
,
38
"phpfunc"
,
39
"elink"
,
40
"phpconstraint"
,
41
"usefor"
,
42
"options"
43
);
44
45
var
$id_fields
= array(
46
"docid"
,
47
"id"
48
);
49
50
var
$dbtable
=
"docattr"
;
51
52
var
$order_by
=
"ordered"
;
53
54
var
$fulltextfields
= array(
55
"labeltext"
56
);
57
58
public
$id
;
59
public
$docid
;
60
public
$frameid
;
61
public
$labeltext
;
62
public
$title
;
63
public
$abstract
;
64
public
$type
;
65
public
$ordered
;
66
public
$visibility
;
// W, R, H, O, M, C
67
public
$needed
;
68
public
$link
;
69
public
$phpfile
;
70
public
$phpfunc
;
71
public
$elink
;
72
public
$phpconstraint
;
73
public
$usefor
;
74
public
$options
;
75
76
var
$sqlcreate
=
"
77
create table docattr ( id name,
78
docid int not null,
79
frameid name,
80
labeltext text,
81
title char,
82
abstract char,
83
type text,
84
ordered int,
85
visibility char,
86
needed char,
87
link text,
88
phpfile text,
89
phpfunc text,
90
elink text,
91
phpconstraint text,
92
usefor char DEFAULT 'N',
93
options text
94
);
95
create sequence seq_id_docattr start 1000;
96
create unique index idx_iddocid on docattr(id, docid);"
;
97
// possible type of attributes
98
var
$deftype
= array(
99
"text"
,
100
"longtext"
,
101
"image"
,
102
"file"
,
103
"frame"
,
104
"enum"
,
105
"date"
,
106
"integer"
,
107
"double"
,
108
"money"
,
109
"password"
110
);
111
112
function
PreInsert
()
113
{
114
// compute new id
115
if
($this->
id
==
""
) {
116
$res
= pg_query($this->dbid,
"select nextval ('seq_id_docattr')"
);
117
$arr = pg_fetch_array(
$res
, 0);
118
$this->
id
=
"auto_"
. $arr[0];
// not a number must be alphanumeric begin with letter
119
120
}
121
$this->
id
= strtolower($this->
id
);
122
if
($this->
id
[0] !=
':'
) {
123
if
($this->
type
==
""
) $this->
type
=
"text"
;
124
if
($this->
abstract
==
""
) $this->
abstract
=
'N'
;
125
if
($this->title ==
""
) $this->title =
'N'
;
126
if
($this->usefor ==
""
) $this->usefor =
'N'
;
127
if
($this->visibility ==
""
) $this->visibility =
'W'
;
128
}
129
}
130
131
public
function
getRawType
(
$type
=
''
)
132
{
133
if
(!
$type
)
$type
=
$this->type
;
134
return
strtok(
$type
,
'('
);
135
}
136
public
function
isStructure
()
137
{
138
$rtype = $this->
getRawType
();
139
return
($rtype ==
"frame"
|| $rtype ==
"tab"
);
140
}
141
public
function
isAbstract
()
142
{
143
return
(strtolower($this->
abstract
) ==
"y"
);
144
}
145
public
function
isTitle
()
146
{
147
return
(strtolower($this->title) ==
"y"
);
148
}
149
public
function
isNeeded
()
150
{
151
return
(strtolower($this->needed) ==
"y"
);
152
}
153
}
154
?>
DocAttr\isAbstract
isAbstract()
Definition:
Class.DocAttr.php:141
DocAttr\$phpfunc
$phpfunc
Definition:
Class.DocAttr.php:70
type
$s type
Definition:
dav.php:73
DocAttr\$id_fields
$id_fields
Definition:
Class.DocAttr.php:45
DocAttr\$deftype
$deftype
Definition:
Class.DocAttr.php:98
DocAttr\$abstract
$abstract
Definition:
Class.DocAttr.php:63
DbObj\$res
$res
Definition:
Class.DbObj.php:90
DocAttr\isStructure
isStructure()
Definition:
Class.DocAttr.php:136
DocAttr\$phpconstraint
$phpconstraint
Definition:
Class.DocAttr.php:72
DocAttr\PreInsert
PreInsert()
Definition:
Class.DocAttr.php:112
DocAttr\$visibility
$visibility
Definition:
Class.DocAttr.php:66
DocAttr\$options
$options
Definition:
Class.DocAttr.php:74
DocAttr\$labeltext
$labeltext
Definition:
Class.DocAttr.php:61
DocAttr\$fields
$fields
Definition:
Class.DocAttr.php:25
DbObj
Definition:
Class.DbObj.php:28
DocAttr\isNeeded
isNeeded()
Definition:
Class.DocAttr.php:149
DocAttr\$id
$id
Definition:
Class.DocAttr.php:58
DocAttr\$order_by
$order_by
Definition:
Class.DocAttr.php:52
DocAttr\$frameid
$frameid
Definition:
Class.DocAttr.php:60
DocAttr\$phpfile
$phpfile
Definition:
Class.DocAttr.php:69
DocAttr\$sqlcreate
$sqlcreate
Definition:
Class.DocAttr.php:76
DocAttr\$needed
$needed
Definition:
Class.DocAttr.php:67
DocAttr\$link
$link
Definition:
Class.DocAttr.php:68
DocAttr\$ordered
$ordered
Definition:
Class.DocAttr.php:65
DocAttr\$fulltextfields
$fulltextfields
Definition:
Class.DocAttr.php:54
DocAttr\$title
$title
Definition:
Class.DocAttr.php:62
DocAttr
Definition:
Class.DocAttr.php:23
DocAttr\getRawType
getRawType($type= '')
Definition:
Class.DocAttr.php:131
DocAttr\$usefor
$usefor
Definition:
Class.DocAttr.php:73
DocAttr\isTitle
isTitle()
Definition:
Class.DocAttr.php:145
DocAttr\$docid
$docid
Definition:
Class.DocAttr.php:59
DocAttr\$elink
$elink
Definition:
Class.DocAttr.php:71
DocAttr\$type
$type
Definition:
Class.DocAttr.php:64
DocAttr\$dbtable
$dbtable
Definition:
Class.DocAttr.php:50
← centre documentaire
© anakeen