ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_RichText Class Reference
+ Inheritance diagram for PHPExcel_RichText:
+ Collaboration diagram for PHPExcel_RichText:

Public Member Functions

 __construct (PHPExcel_Cell $pCell=null)
 Create a new PHPExcel_RichText instance.
 addText (PHPExcel_RichText_ITextElement $pText=null)
 Add text.
 createText ($pText= '')
 Create text.
 createTextRun ($pText= '')
 Create text run.
 getPlainText ()
 Get plain text.
 __toString ()
 Convert to string.
 getRichTextElements ()
 Get Rich Text elements.
 setRichTextElements ($pElements=null)
 Set Rich Text elements.
 getHashCode ()
 Get hash code.
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.

Private Attributes

 $_richTextElements

Detailed Description

Definition at line 36 of file RichText.php.

Constructor & Destructor Documentation

PHPExcel_RichText::__construct ( PHPExcel_Cell  $pCell = null)

Create a new PHPExcel_RichText instance.

Parameters
PHPExcel_Cell$pParent
Exceptions
Exception

Definition at line 51 of file RichText.php.

References addText(), PHPExcel_RichText_Run\setFont(), and PHPExcel_Cell_DataType\TYPE_STRING.

{
// Initialise variables
$this->_richTextElements = array();
// Rich-Text string attached to cell?
if (!is_null($pCell)) {
// Add cell text and style
if ($pCell->getValue() != "") {
$objRun = new PHPExcel_RichText_Run($pCell->getValue());
$objRun->setFont(clone $pCell->getParent()->getStyle($pCell->getCoordinate())->getFont());
$this->addText($objRun);
}
// Set parent value
}
}

+ Here is the call graph for this function:

Member Function Documentation

PHPExcel_RichText::__clone ( )

Implement PHP __clone to create a deep clone, not just a shallow copy.

Definition at line 186 of file RichText.php.

{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
PHPExcel_RichText::__toString ( )

Convert to string.

Returns
string

Definition at line 135 of file RichText.php.

References getPlainText().

{
return $this->getPlainText();
}

+ Here is the call graph for this function:

PHPExcel_RichText::addText ( PHPExcel_RichText_ITextElement  $pText = null)

Add text.

Parameters
PHPExcel_RichText_ITextElement$pTextRich text element
Exceptions
Exception
Returns
PHPExcel_RichText

Definition at line 77 of file RichText.php.

Referenced by __construct(), createText(), and createTextRun().

{
$this->_richTextElements[] = $pText;
return $this;
}

+ Here is the caller graph for this function:

PHPExcel_RichText::createText (   $pText = '')

Create text.

Parameters
string$pTextText
Returns
PHPExcel_RichText_TextElement
Exceptions
Exception

Definition at line 90 of file RichText.php.

References addText().

{
$objText = new PHPExcel_RichText_TextElement($pText);
$this->addText($objText);
return $objText;
}

+ Here is the call graph for this function:

PHPExcel_RichText::createTextRun (   $pText = '')

Create text run.

Parameters
string$pTextText
Returns
PHPExcel_RichText_Run
Exceptions
Exception

Definition at line 104 of file RichText.php.

References addText().

{
$objText = new PHPExcel_RichText_Run($pText);
$this->addText($objText);
return $objText;
}

+ Here is the call graph for this function:

PHPExcel_RichText::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 171 of file RichText.php.

{
$hashElements = '';
foreach ($this->_richTextElements as $element) {
$hashElements .= $element->getHashCode();
}
return md5(
$hashElements
. __CLASS__
);
}
PHPExcel_RichText::getPlainText ( )

Get plain text.

Returns
string

Definition at line 116 of file RichText.php.

Referenced by __toString().

{
// Return value
$returnValue = '';
// Loop through all PHPExcel_RichText_ITextElement
foreach ($this->_richTextElements as $text) {
$returnValue .= $text->getText();
}
// Return
return $returnValue;
}

+ Here is the caller graph for this function:

PHPExcel_RichText::getRichTextElements ( )

Get Rich Text elements.

Returns
PHPExcel_RichText_ITextElement[]

Definition at line 144 of file RichText.php.

References $_richTextElements.

PHPExcel_RichText::setRichTextElements (   $pElements = null)

Set Rich Text elements.

Parameters
PHPExcel_RichText_ITextElement[]$pElements Array of elements
Exceptions
Exception
Returns
PHPExcel_RichText

Definition at line 156 of file RichText.php.

{
if (is_array($pElements)) {
$this->_richTextElements = $pElements;
} else {
throw new Exception("Invalid PHPExcel_RichText_ITextElement[] array passed.");
}
return $this;
}

Field Documentation

PHPExcel_RichText::$_richTextElements
private

Definition at line 43 of file RichText.php.

Referenced by getRichTextElements().


The documentation for this class was generated from the following file: