creole.util
[ class tree: creole.util ] [ index: creole.util ] [ all elements ]

Class: Lob

Source Location: /creole/util/Lob.php

Class Overview


An abstract class for handling LOB (Locator Object) columns.


Author(s):

Version:

  • $Revision: 1.10 $

Variables

Methods


Child classes:

Blob
A class for handling binary LOBs.
Clob
A class for handling character (ASCII) LOBs.

Class Details

[line 29]
An abstract class for handling LOB (Locator Object) columns.



Tags:

abstract:  
version:  $Revision: 1.10 $
author:  Hans Lellelid <hans@xmpl.org>


[ Top ]


Class Variables

$data =

[line 37]

The contents of the Lob.

DO NOT SET DIRECTLY (or you will disrupt the ability of isModified() to give accurate results).




Tags:

access:  protected

Type:   string


[ Top ]

$inFile =

[line 49]

File that blob should be read in from



Tags:

access:  protected

Type:   string


[ Top ]

$outFile =

[line 43]

File that blob should be written out to.



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 66]

Lob __construct( [sttring $data = null])

Construct a new Lob.



Tags:

access:  public
see:  Lob::setContents()


Parameters:

sttring   $data   The data contents of the Lob.

[ Top ]

method dump [line 117]

void dump( )

Dump the contents of the file to stdout.

Must be implemented by subclasses so that binary status is handled correctly. (i.e. ignored for Clob, handled for Blob)




Tags:

access:  public
abstract:  
throws:  Exception if no file or contents.


Overridden in child classes as:

Blob::dump()
Dump the contents of the file using fpassthru().
Clob::dump()
Dump the contents of the file using fpassthru().

[ Top ]

method getContents [line 78]

string getContents( )

Get the contents of the LOB.



Tags:

return:  The characters in this LOB.
access:  public
throws:  Exception


[ Top ]

method getInputFile [line 133]

string getInputFile( )

Get the file that we want this LOB read from.



Tags:

return:  The location of the file.
access:  public


[ Top ]

method getOutputFile [line 152]

string getOutputFile( )

Get the file that we want this LOB saved to.



Tags:

return:  The location of the file.
access:  public


[ Top ]

method isFromFile [line 162]

boolean isFromFile( )

Returns whether this Lob is loaded from file.

This is useful for bypassing need to read in the contents of the Lob.




Tags:

return:  Whether this LOB is to be read from a file.
access:  public


[ Top ]

method isModified [line 238]

boolean isModified( )

Whether LOB contents have been modified after initial setting.



Tags:

return:  TRUE if the contents have been modified after initial setting. FALSE if contents have not been modified or if no contents have bene set.
access:  public


[ Top ]

method readFromFile [line 176]

void readFromFile( [string $file = null])

Read LOB data from file (binary safe).

(Implementation may need to be moved into Clob / Blob subclasses, but since file_get_contents() is binary-safe, it hasn't been necessary so far.)




Tags:

access:  public
see:  Lob::setInputFile()
throws:  Exception - if no file specified or error on read.


Overridden in child classes as:

Clob::readFromFile()
Read LOB data from file.

Parameters:

string   $file   Filename may also be specified here (if not specified using setInputFile()).

[ Top ]

method setContents [line 93]

void setContents( mixed $data, string $bytes)

Set the contents of this LOB.

Sets the modified flag to FALSE if this is the first call to setContents() for this object. Sets the bit to TRUE if this any subsequent call to setContents().




Tags:

access:  public


Parameters:

string   $bytes  

[ Top ]

method setInputFile [line 124]

void setInputFile( string $filePath)

Specify the file that we want this LOB read from.



Tags:

access:  public


Parameters:

string   $filePath   The location of the file.

[ Top ]

method setModified [line 228]

void setModified( boolean $b)

Set whether LOB contents have been modified after initial setting.



Tags:

access:  public


Parameters:

boolean   $b  

[ Top ]

method setOutputFile [line 143]

void setOutputFile( string $filePath)

Specify the file that we want this LOB saved to.



Tags:

access:  public


Parameters:

string   $filePath   The location of the file.

[ Top ]

method writeToFile [line 199]

void writeToFile( [string $file = null])

Write LOB data to file (binary safe).

(Impl may need to move into subclasses, but so far not necessary.)




Tags:

access:  public
see:  Lob::setOutputFile()
throws:  Exception - if no file specified, no contents to write, or error on write.


Overridden in child classes as:

Clob::writeToFile()
Write LOB data to file.

Parameters:

string   $file   Filename may also be specified here (if not set using setOutputFile()).

[ Top ]

method __toString [line 219]

string __toString( )

Convenience method to get contents of LOB as string.



Tags:

access:  public


[ Top ]


Documentation generated on Mon, 23 Aug 2004 21:51:33 -0400 by phpDocumentor 1.3.0RC3