File tree 7 files changed +113
-11
lines changed
7 files changed +113
-11
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,6 @@ abstract class Zend_Pdf_Element
45
45
*/
46
46
private $ _parentObject = null ;
47
47
48
- /**
49
- * Object value
50
- *
51
- * @var string
52
- */
53
- public $ value ;
54
-
55
48
/**
56
49
* Return type of the element.
57
50
* See ZPdfPDFConst for possible values
@@ -138,10 +131,7 @@ public function cleanUp()
138
131
*
139
132
* @return mixed
140
133
*/
141
- public function toPhp ()
142
- {
143
- return $ this ->value ;
144
- }
134
+ abstract public function toPhp ();
145
135
146
136
/**
147
137
* Convert PHP value into PDF element.
Original file line number Diff line number Diff line change 34
34
*/
35
35
class Zend_Pdf_Element_Boolean extends Zend_Pdf_Element
36
36
{
37
+ /**
38
+ * Object value
39
+ *
40
+ * @var boolean
41
+ */
42
+ public $ value ;
43
+
44
+
37
45
/**
38
46
* Object constructor
39
47
*
@@ -72,4 +80,15 @@ public function toString($factory = null)
72
80
{
73
81
return $ this ->value ? 'true ' : 'false ' ;
74
82
}
83
+
84
+
85
+ /**
86
+ * Convert PDF element to PHP type.
87
+ *
88
+ * @return boolean
89
+ */
90
+ public function toPhp ()
91
+ {
92
+ return $ this ->value ;
93
+ }
75
94
}
Original file line number Diff line number Diff line change 34
34
*/
35
35
class Zend_Pdf_Element_Name extends Zend_Pdf_Element
36
36
{
37
+ /**
38
+ * Object value
39
+ *
40
+ * @var string
41
+ */
42
+ public $ value ;
43
+
44
+
37
45
/**
38
46
* Object constructor
39
47
*
@@ -150,4 +158,15 @@ public function toString($factory = null)
150
158
{
151
159
return '/ ' . self ::escape ((string )$ this ->value );
152
160
}
161
+
162
+
163
+ /**
164
+ * Convert PDF element to PHP type.
165
+ *
166
+ * @return string
167
+ */
168
+ public function toPhp ()
169
+ {
170
+ return $ this ->value ;
171
+ }
153
172
}
Original file line number Diff line number Diff line change 34
34
*/
35
35
class Zend_Pdf_Element_Null extends Zend_Pdf_Element
36
36
{
37
+ /**
38
+ * Object value. Always null.
39
+ *
40
+ * @var mixed
41
+ */
42
+ public $ value ;
43
+
44
+
37
45
/**
38
46
* Object constructor
39
47
*/
@@ -64,4 +72,15 @@ public function toString($factory = null)
64
72
{
65
73
return 'null ' ;
66
74
}
75
+
76
+
77
+ /**
78
+ * Convert PDF element to PHP type.
79
+ *
80
+ * @return mixed
81
+ */
82
+ public function toPhp ()
83
+ {
84
+ return $ this ->value ;
85
+ }
67
86
}
Original file line number Diff line number Diff line change 34
34
*/
35
35
class Zend_Pdf_Element_Numeric extends Zend_Pdf_Element
36
36
{
37
+ /**
38
+ * Object value
39
+ *
40
+ * @var numeric
41
+ */
42
+ public $ value ;
43
+
44
+
37
45
/**
38
46
* Object constructor
39
47
*
@@ -84,4 +92,15 @@ public function toString($factory = null)
84
92
}
85
93
return sprintf ("%. {$ prec }F " , $ this ->value );
86
94
}
95
+
96
+
97
+ /**
98
+ * Convert PDF element to PHP type.
99
+ *
100
+ * @return numeric
101
+ */
102
+ public function toPhp ()
103
+ {
104
+ return $ this ->value ;
105
+ }
87
106
}
Original file line number Diff line number Diff line change 37
37
*/
38
38
class Zend_Pdf_Element_Stream extends Zend_Pdf_Element
39
39
{
40
+ /**
41
+ * Object value
42
+ *
43
+ * @var Zend_Memory_Container
44
+ */
45
+ public $ value ;
46
+
47
+
40
48
/**
41
49
* Object constructor
42
50
*
@@ -119,4 +127,14 @@ public function toString($factory = null)
119
127
{
120
128
return "stream \n" . $ this ->value ->getRef () . "\nendstream " ;
121
129
}
130
+
131
+ /**
132
+ * Convert PDF element to PHP type.
133
+ *
134
+ * @return Zend_Memory_Container
135
+ */
136
+ public function toPhp ()
137
+ {
138
+ return $ this ->value ;
139
+ }
122
140
}
Original file line number Diff line number Diff line change 33
33
*/
34
34
class Zend_Pdf_Element_String extends Zend_Pdf_Element
35
35
{
36
+ /**
37
+ * Object value
38
+ *
39
+ * @var string
40
+ */
41
+ public $ value ;
42
+
36
43
/**
37
44
* Object constructor
38
45
*
@@ -67,6 +74,17 @@ public function toString($factory = null)
67
74
}
68
75
69
76
77
+ /**
78
+ * Convert PDF element to PHP type.
79
+ *
80
+ * @return string
81
+ */
82
+ public function toPhp ()
83
+ {
84
+ return $ this ->value ;
85
+ }
86
+
87
+
70
88
/**
71
89
* Escape string according to the PDF rules
72
90
*
You can’t perform that action at this time.
0 commit comments