Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
zendframework1
library
Zend
Pdf
FileParserDataSource
String.php
Go to the documentation of this file.
1
<?php
24
#require_once 'Zend/Pdf/FileParserDataSource.php';
25
35
class
Zend_Pdf_FileParserDataSource_String
extends
Zend_Pdf_FileParserDataSource
36
{
37
/**** Instance Variables ****/
38
39
44
protected
$_string
=
''
;
45
46
47
48
/**** Public Interface ****/
49
50
51
/* Concrete Class Implementation */
52
60
public
function
__construct
($string)
61
{
62
if
(empty($string)) {
63
#require_once 'Zend/Pdf/Exception.php';
64
throw
new
Zend_Pdf_Exception
(
'String is empty'
,
65
Zend_Pdf_Exception::PARAMETER_VALUE_OUT_OF_RANGE
);
66
}
67
$this->_size = strlen($string);
68
$this->_string = $string;
69
}
70
74
public
function
__destruct
()
75
{
76
$this->_string =
''
;
77
}
78
92
public
function
readBytes
($byteCount)
93
{
94
if
(($this->_offset + $byteCount) > $this->_size) {
95
#require_once 'Zend/Pdf/Exception.php';
96
throw
new
Zend_Pdf_Exception
(
"Insufficient data to read $byteCount bytes"
,
97
Zend_Pdf_Exception::INSUFFICIENT_DATA
);
98
}
99
$bytes = substr($this->_string, $this->_offset, $byteCount);
100
$this->_offset += $byteCount;
101
return
$bytes;
102
}
103
111
public
function
readAllBytes
()
112
{
113
return
$this->_string
;
114
}
115
116
117
/* Object Magic Methods */
118
124
public
function
__toString
()
125
{
126
return
"String ($this->_size bytes)"
;
127
}
128
}
Zend_Pdf_FileParserDataSource
Definition:
FileParserDataSource.php:41
Zend_Pdf_Exception\PARAMETER_VALUE_OUT_OF_RANGE
const PARAMETER_VALUE_OUT_OF_RANGE
Definition:
Exception.php:89
Zend_Pdf_FileParserDataSource_String\readAllBytes
readAllBytes()
Definition:
String.php:111
Zend_Pdf_FileParserDataSource_String\__destruct
__destruct()
Definition:
String.php:74
Zend_Pdf_FileParserDataSource_String\__toString
__toString()
Definition:
String.php:124
Zend_Pdf_FileParserDataSource_String\__construct
__construct($string)
Definition:
String.php:60
Zend_Pdf_Exception\INSUFFICIENT_DATA
const INSUFFICIENT_DATA
Definition:
Exception.php:177
Zend_Pdf_FileParserDataSource_String\$_string
$_string
Definition:
String.php:44
Zend_Pdf_Exception
Definition:
Exception.php:51
Zend_Pdf_FileParserDataSource_String\readBytes
readBytes($byteCount)
Definition:
String.php:92
Zend_Pdf_FileParserDataSource_String
Definition:
String.php:35