LOB
class LOB (View source)
A large object.
NOTE: Working with large objects requires an active transaction.
Constants
INVALID_OID |
0, representing an invalid OID. |
RW |
Read/write mode. |
Properties
Transaction read-only | $transaction | The transaction wrapping the operations on the large object. |
|
int read-only | $oid | The OID of the large object. |
|
resource read-only | $stream | The stream connected to the large object. |
Methods
Open or create a large object.
Read a string of data from the current position of the large object.
Seek to a position within the large object.
Retrieve the current position within the large object.
Truncate the large object.
Write data to the large object.
Details
__construct(Transaction $txn, int $oid = \pq\LOB::INVALID_OID, int $mode = \pq\LOB::RW)
Open or create a large object.
See pq\Transaction::openLOB() and pq\Transaction::createLOB().
string
read(int $length = 0x1000, int $read = null)
Read a string of data from the current position of the large object.
int
seek(int $offset, int $whence = SEEK_SET)
Seek to a position within the large object.
int
tell()
Retrieve the current position within the large object.
truncate(int $length = 0)
Truncate the large object.
int
write(string $data)
Write data to the large object.