ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Cell Class Reference
+ Collaboration diagram for PHPExcel_Cell:

Public Member Functions

 __construct ($pColumn= 'A', $pRow=1, $pValue=null, $pDataType=null, PHPExcel_Worksheet $pSheet=null)
 Create a new Cell.
 getColumn ()
 Get cell coordinate column.
 getRow ()
 Get cell coordinate row.
 getCoordinate ()
 Get cell coordinate.
 getValue ()
 Get cell value.
 setValue ($pValue=null)
 Set cell value.
 setValueExplicit ($pValue=null, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING)
 Set cell value (with explicit data type given)
 getCalculatedValue ($resetLog=true)
 Get caluclated cell value.
 setCalculatedValue ($pValue=null)
 Set calculated value (used for caching)
 getOldCalculatedValue ()
 Get old calculated value (cached)
 getDataType ()
 Get cell data type.
 setDataType ($pDataType=PHPExcel_Cell_DataType::TYPE_STRING)
 Set cell data type.
 hasDataValidation ()
 Has Data validation?
 getDataValidation ()
 Get Data validation.
 setDataValidation (PHPExcel_Cell_DataValidation $pDataValidation=null)
 Set Data validation.
 hasHyperlink ()
 Has Hyperlink.
 getHyperlink ()
 Get Hyperlink.
 setHyperlink (PHPExcel_Cell_Hyperlink $pHyperlink=null)
 Set Hyperlink.
 getParent ()
 Get parent.
 rebindParent (PHPExcel_Worksheet $parent)
 Re-bind parent.
 isInRange ($pRange= 'A1:A1')
 Is cell in a specific range?
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.
 getXfIndex ()
 Get index to cellXf.
 setXfIndex ($pValue=0)
 Set index to cellXf.

Static Public Member Functions

static coordinateFromString ($pCoordinateString= 'A1')
 Coordinate from string.
static absoluteCoordinate ($pCoordinateString= 'A1')
 Make string coordinate absolute.
static splitRange ($pRange= 'A1:A1')
 Split range into coordinate strings.
static buildRange ($pRange)
 Build range from coordinate strings.
static rangeDimension ($pRange= 'A1:A1')
 Calculate range dimension.
static columnIndexFromString ($pString= 'A')
 Column index from string.
static stringFromColumnIndex ($pColumnIndex=0)
 String from columnindex.
static extractAllCellReferencesInRange ($pRange= 'A1')
 Extract all cell references in range.
static compareCells (PHPExcel_Cell $a, PHPExcel_Cell $b)
 Compare 2 cells.
static getValueBinder ()
 Get value binder to use.
static setValueBinder (PHPExcel_Cell_IValueBinder $binder=null)
 Set value binder to use.

Private Attributes

 $_column
 $_row
 $_value
 $_calculatedValue = null
 $_dataType
 $_parent
 $_xfIndex

Static Private Attributes

static $_valueBinder = null

Detailed Description

Definition at line 69 of file Cell.php.

Constructor & Destructor Documentation

PHPExcel_Cell::__construct (   $pColumn = 'A',
  $pRow = 1,
  $pValue = null,
  $pDataType = null,
PHPExcel_Worksheet  $pSheet = null 
)

Create a new Cell.

Parameters
string$pColumn
int$pRow
mixed$pValue
string$pDataType
PHPExcel_Worksheet$pSheet
Exceptions
Exception

Definition at line 137 of file Cell.php.

{
// Set value binder?
if (is_null(self::$_valueBinder)) {
self::$_valueBinder = new PHPExcel_Cell_DefaultValueBinder();
}
// Initialise cell coordinate
$this->_column = strtoupper($pColumn);
$this->_row = $pRow;
// Initialise cell value
$this->_value = $pValue;
// Set worksheet
$this->_parent = $pSheet;
// Set datatype?
if (!is_null($pDataType)) {
$this->_dataType = $pDataType;
} else {
if (!self::getValueBinder()->bindValue($this, $pValue)) {
throw new Exception("Value could not be bound to cell.");
}
}
// set default index to cellXf
$this->_xfIndex = 0;
}

Member Function Documentation

PHPExcel_Cell::__clone ( )

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

Definition at line 768 of file Cell.php.

References $key.

{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
static PHPExcel_Cell::absoluteCoordinate (   $pCoordinateString = 'A1')
static

Make string coordinate absolute.

Parameters
string$pCoordinateString
Returns
string Absolute coordinate
Exceptions
Exception

Definition at line 521 of file Cell.php.

References $row, and coordinateFromString().

{
if (strpos($pCoordinateString,':') === false && strpos($pCoordinateString,',') === false) {
// Return value
$returnValue = '';
// Create absolute coordinate
list($column, $row) = PHPExcel_Cell::coordinateFromString($pCoordinateString);
$returnValue = '$' . $column . '$' . $row;
// Return
return $returnValue;
} else {
throw new Exception("Coordinate string should not be a cell range.");
}
}

+ Here is the call graph for this function:

static PHPExcel_Cell::buildRange (   $pRange)
static

Build range from coordinate strings.

Parameters
array$pRangeArray containg one or more arrays containing one or two coordinate strings
Returns
string String representation of $pRange
Exceptions
Exception

Definition at line 560 of file Cell.php.

Referenced by PHPExcel_ReferenceHelper\_updateCellRange().

{
// Verify range
if (!is_array($pRange) || count($pRange) == 0 || !is_array($pRange[0])) {
throw new Exception('Range does not contain any information.');
}
// Build range
$imploded = array();
for ($i = 0; $i < count($pRange); ++$i) {
$pRange[$i] = implode(':', $pRange[$i]);
}
$imploded = implode(',', $pRange);
return $imploded;
}

+ Here is the caller graph for this function:

static PHPExcel_Cell::columnIndexFromString (   $pString = 'A')
static

Column index from string.

Parameters
string$pString
Returns
int Column index (base 1 !!!)
Exceptions
Exception

Definition at line 616 of file Cell.php.

References $result, and elseif().

Referenced by PHPExcel_Writer_Excel5_Worksheet\__construct(), PHPExcel_Reader_Excel2007\_castToFormula(), PHPExcel_Writer_HTML\_generateRow(), PHPExcel_Writer_HTML\_generateTableHeader(), PHPExcel_Reader_Excel5\_readBIFF8CellAddressB(), PHPExcel_Writer_Excel5_Worksheet\_storeBreaks(), PHPExcel_Writer_Excel5_Worksheet\_storeMergedCells(), PHPExcel_Writer_Excel5_Workbook\_storeNames(), PHPExcel_Writer_Excel5_Worksheet\_storePanes(), PHPExcel_ReferenceHelper\_updateSingleCellReference(), PHPExcel_Writer_Excel5_Workbook\_writeAllDefinedNamesBiff8(), PHPExcel_Writer_Excel5_Worksheet\_writeBIFF8CellRangeAddressFixed(), PHPExcel_Writer_Excel2007_Worksheet\_writeBreaks(), PHPExcel_Writer_Excel2007_Worksheet\_writeCols(), PHPExcel_Writer_Excel2007_Drawing\_writeDrawing(), PHPExcel_Writer_Excel2007_Worksheet\_writeSheetData(), PHPExcel_Writer_Excel2007_Worksheet\_writeSheetViews(), PHPExcel_Writer_Excel2007_Comments\_writeVMLComment(), PHPExcel_Style\applyFromArray(), PHPExcel_Writer_HTML\buildCSS(), PHPExcel_Writer_Excel5_Escher\close(), PHPExcel_Writer_Excel5_Worksheet\close(), PHPExcel_Calculation_Functions\COLUMN(), compareCells(), PHPExcel_Worksheet\duplicateStyle(), extractAllCellReferencesInRange(), PHPExcel_Worksheet\fromArray(), PHPExcel_Writer_HTML\generateSheetData(), PHPExcel_Shared_Excel5\getDistanceX(), PHPExcel_Worksheet\getHighestColumn(), PHPExcel_ReferenceHelper\insertNewBefore(), isInRange(), PHPExcel_Calculation_Functions\OFFSET(), PHPExcel_Shared_Excel5\oneAnchor2twoAnchor(), rangeDimension(), PHPExcel_Worksheet\removeColumn(), PHPExcel_Worksheet\sortCellCollection(), PHPExcel_Worksheet\toArray(), and PHPExcel_Worksheet_CellIterator\valid().

{
// Convert to uppercase
$pString = strtoupper($pString);
$strLen = strlen($pString);
// Convert column to integer
if ($strLen == 1) {
return (ord($pString{0}) - 64);
} elseif ($strLen == 2) {
return $result = ((1 + (ord($pString{0}) - 65)) * 26) + (ord($pString{1}) - 64);
} elseif ($strLen == 3) {
return ((1 + (ord($pString{0}) - 65)) * 676) + ((1 + (ord($pString{1}) - 65)) * 26) + (ord($pString{2}) - 64);
} else {
throw new Exception("Column string index can not be " . ($strLen != 0 ? "longer than 3 characters" : "empty") . ".");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Cell::compareCells ( PHPExcel_Cell  $a,
PHPExcel_Cell  $b 
)
static

Compare 2 cells.

Parameters
PHPExcel_Cell$aCell a
PHPExcel_Cell$aCell b
Returns
int Result of comparison (always -1 or 1, never zero!)

Definition at line 729 of file Cell.php.

References columnIndexFromString(), and elseif().

{
if ($a->_row < $b->_row) {
return -1;
} elseif ($a->_row > $b->_row) {
return 1;
return -1;
} else {
return 1;
}
}

+ Here is the call graph for this function:

static PHPExcel_Cell::coordinateFromString (   $pCoordinateString = 'A1')
static

Coordinate from string.

Parameters
string$pCoordinateString
Returns
array Array containing column and row (indexes 0 and 1)
Exceptions
Exception

Definition at line 491 of file Cell.php.

References $row.

Referenced by PHPExcel_Reader_Excel2007\_castToFormula(), PHPExcel_Reader_Excel5\_readBIFF8CellAddressB(), PHPExcel_Writer_Excel5_Worksheet\_storeBreaks(), PHPExcel_Writer_Excel5_Worksheet\_storeMergedCells(), PHPExcel_Writer_Excel5_Workbook\_storeNames(), PHPExcel_Writer_Excel5_Worksheet\_storePanes(), PHPExcel_ReferenceHelper\_updateSingleCellReference(), PHPExcel_Writer_Excel5_Workbook\_writeAllDefinedNamesBiff8(), PHPExcel_Writer_Excel5_Worksheet\_writeBIFF8CellRangeAddressFixed(), PHPExcel_Writer_Excel2007_Worksheet\_writeBreaks(), PHPExcel_Writer_Excel2007_Drawing\_writeDrawing(), PHPExcel_Writer_Excel2007_Worksheet\_writeSheetViews(), PHPExcel_Writer_Excel2007_Comments\_writeVMLComment(), absoluteCoordinate(), PHPExcel_Style\applyFromArray(), PHPExcel_Worksheet\cellExists(), PHPExcel_Writer_Excel5_Escher\close(), PHPExcel_Worksheet\duplicateStyle(), extractAllCellReferencesInRange(), PHPExcel_Calculation\extractCellRange(), PHPExcel_Calculation\extractNamedRange(), PHPExcel_Worksheet\fromArray(), PHPExcel_Writer_HTML\generateSheetData(), PHPExcel_Worksheet\getCell(), PHPExcel_ReferenceHelper\insertNewBefore(), isInRange(), PHPExcel_Reader_Excel2007\load(), PHPExcel_Reader_Excel5\load(), PHPExcel_Shared_Excel5\oneAnchor2twoAnchor(), rangeDimension(), and PHPExcel_Worksheet\toArray().

{
if (strpos($pCoordinateString,':') !== false) {
throw new Exception('Cell coordinate string can not be a range of cells.');
} else if ($pCoordinateString == '') {
throw new Exception('Cell coordinate can not be zero-length string.');
} else {
// Column
$column = '';
// Row
$row = '';
// Convert a cell reference
if (preg_match("/([$]?[A-Z]+)([$]?\d+)/", $pCoordinateString, $matches)) {
list(, $column, $row) = $matches;
}
// Return array
return array($column, $row);
}
}

+ Here is the caller graph for this function:

static PHPExcel_Cell::extractAllCellReferencesInRange (   $pRange = 'A1')
static

Extract all cell references in range.

Parameters
string$pRangeRange (e.g. A1 or A1:A10 or A1:A10 A100:A1000)
Returns
array Array containing single cell references

Definition at line 655 of file Cell.php.

References $row, columnIndexFromString(), coordinateFromString(), splitRange(), and stringFromColumnIndex().

Referenced by PHPExcel_Reader_Excel5\_readHyperLink(), PHPExcel_Calculation\extractCellRange(), PHPExcel_Calculation\extractNamedRange(), PHPExcel_Reader_Excel2007\load(), and PHPExcel_Style\setConditionalStyles().

{
// Returnvalue
$returnValue = array();
// Explode spaces
$aExplodeSpaces = explode(' ', str_replace('$', '', strtoupper($pRange)));
foreach ($aExplodeSpaces as $explodedSpaces) {
// Single cell?
if (strpos($explodedSpaces,':') === false && strpos($explodedSpaces,',') === false) {
$col = 'A';
$row = 1;
list($col, $row) = PHPExcel_Cell::coordinateFromString($explodedSpaces);
if (strlen($col) <= 2) {
$returnValue[] = $explodedSpaces;
}
continue;
}
// Range...
$range = PHPExcel_Cell::splitRange($explodedSpaces);
for ($i = 0; $i < count($range); ++$i) {
// Single cell?
if (count($range[$i]) == 1) {
$col = 'A';
$row = 1;
list($col, $row) = PHPExcel_Cell::coordinateFromString($range[$i]);
if (strlen($col) <= 2) {
$returnValue[] = $explodedSpaces;
}
}
// Range...
$rangeStart = $rangeEnd = '';
$startingCol = $startingRow = $endingCol = $endingRow = 0;
list($rangeStart, $rangeEnd) = $range[$i];
list($startingCol, $startingRow) = PHPExcel_Cell::coordinateFromString($rangeStart);
list($endingCol, $endingRow) = PHPExcel_Cell::coordinateFromString($rangeEnd);
// Conversions...
$startingCol = PHPExcel_Cell::columnIndexFromString($startingCol);
$endingCol = PHPExcel_Cell::columnIndexFromString($endingCol);
// Current data
$currentCol = --$startingCol;
$currentRow = $startingRow;
// Loop cells
while ($currentCol < $endingCol) {
$loopColumn = PHPExcel_Cell::stringFromColumnIndex($currentCol);
while ($currentRow <= $endingRow) {
$returnValue[] = $loopColumn.$currentRow;
++$currentRow;
}
++$currentCol;
$currentRow = $startingRow;
}
}
}
// Return value
return $returnValue;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Cell::getCalculatedValue (   $resetLog = true)

Get caluclated cell value.

Returns
mixed

Definition at line 252 of file Cell.php.

References $_calculatedValue, $_value, $result, PHPExcel_Calculation\getInstance(), and PHPExcel_Cell_DataType\TYPE_FORMULA.

{
// echo 'Cell '.$this->getCoordinate().' value is a '.$this->_dataType.' with a value of '.$this->getValue().'<br />';
if (!is_null($this->_calculatedValue) && $this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) {
try {
// echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value<br />';
$result = PHPExcel_Calculation::getInstance()->calculateCellValue($this,$resetLog);
} catch ( Exception $ex ) {
// echo 'Calculation Exception: '.$ex->getMessage().'<br />';
$result = '#N/A';
}
if ((is_string($result)) && ($result == '#Not Yet Implemented')) {
// echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().'<br />';
return $this->_calculatedValue; // Fallback if calculation engine does not support the formula.
} else {
// echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().'<br />';
return $result;
}
}
if (is_null($this->_value)) {
// echo 'Cell '.$this->getCoordinate().' has no value, formula or otherwise<br />';
return null;
} else if ($this->_dataType != PHPExcel_Cell_DataType::TYPE_FORMULA) {
// echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->_value.'<br />';
return $this->_value;
} else {
// echo 'Cell value is a formula: Calculating value<br />';
return PHPExcel_Calculation::getInstance()->calculateCellValue($this,$resetLog);
}
}

+ Here is the call graph for this function:

PHPExcel_Cell::getColumn ( )

Get cell coordinate column.

Returns
string

Definition at line 172 of file Cell.php.

Referenced by isInRange().

{
return strtoupper($this->_column);
}

+ Here is the caller graph for this function:

PHPExcel_Cell::getCoordinate ( )

Get cell coordinate.

Returns
string

Definition at line 192 of file Cell.php.

References $_row.

Referenced by PHPExcel_Cell_AdvancedValueBinder\bindValue(), getDataValidation(), getHyperlink(), hasDataValidation(), hasHyperlink(), PHPExcel_Shared_Date\isDateTime(), setDataValidation(), and setHyperlink().

{
return $this->_column . $this->_row;
}

+ Here is the caller graph for this function:

PHPExcel_Cell::getDataType ( )

Get cell data type.

Returns
string

Definition at line 314 of file Cell.php.

References $_dataType.

{
}
PHPExcel_Cell::getDataValidation ( )

Get Data validation.

Returns
PHPExcel_Cell_DataValidation

Definition at line 350 of file Cell.php.

References getCoordinate().

{
if (!isset($this->_parent)) {
throw new Exception('Cannot get data validation for cell that is not bound to a worksheet');
}
$dataValidation = $this->_parent->getDataValidation($this->getCoordinate());
return $dataValidation;
}

+ Here is the call graph for this function:

PHPExcel_Cell::getHyperlink ( )

Get Hyperlink.

Exceptions
Exception
Returns
PHPExcel_Cell_Hyperlink

Definition at line 397 of file Cell.php.

References getCoordinate().

{
if (!isset($this->_parent)) {
throw new Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
}
$hyperlink = $this->_parent->getHyperlink($this->getCoordinate());
return $hyperlink;
}

+ Here is the call graph for this function:

PHPExcel_Cell::getOldCalculatedValue ( )

Get old calculated value (cached)

Returns
mixed

Definition at line 304 of file Cell.php.

References $_calculatedValue.

PHPExcel_Cell::getParent ( )

Get parent.

Returns
PHPExcel_Worksheet

Definition at line 429 of file Cell.php.

References $_parent.

Referenced by PHPExcel_Cell_AdvancedValueBinder\bindValue(), and PHPExcel_Shared_Date\isDateTime().

{
}

+ Here is the caller graph for this function:

PHPExcel_Cell::getRow ( )

Get cell coordinate row.

Returns
int

Definition at line 182 of file Cell.php.

References $_row.

Referenced by isInRange().

{
return $this->_row;
}

+ Here is the caller graph for this function:

PHPExcel_Cell::getValue ( )

Get cell value.

Returns
mixed

Definition at line 202 of file Cell.php.

References $_value.

{
return $this->_value;
}
static PHPExcel_Cell::getValueBinder ( )
static

Get value binder to use.

Returns
PHPExcel_Cell_IValueBinder

Definition at line 747 of file Cell.php.

References $_valueBinder.

{
}
PHPExcel_Cell::getXfIndex ( )

Get index to cellXf.

Returns
int

Definition at line 784 of file Cell.php.

References $_xfIndex.

{
}
PHPExcel_Cell::hasDataValidation ( )

Has Data validation?

Returns
boolean

Definition at line 336 of file Cell.php.

References getCoordinate().

{
if (!isset($this->_parent)) {
throw new Exception('Cannot check for data validation when cell is not bound to a worksheet');
}
return $this->_parent->dataValidationExists($this->getCoordinate());
}

+ Here is the call graph for this function:

PHPExcel_Cell::hasHyperlink ( )

Has Hyperlink.

Returns
boolean

Definition at line 382 of file Cell.php.

References getCoordinate().

{
if (!isset($this->_parent)) {
throw new Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
}
return $this->_parent->hyperlinkExists($this->getCoordinate());
}

+ Here is the call graph for this function:

PHPExcel_Cell::isInRange (   $pRange = 'A1:A1')

Is cell in a specific range?

Parameters
string$pRangeCell range (e.g. A1:A1)
Returns
boolean

Definition at line 450 of file Cell.php.

References columnIndexFromString(), coordinateFromString(), getColumn(), and getRow().

:A1')
{
// Uppercase coordinate
$pRange = strtoupper($pRange);
// Extract range
$rangeA = '';
$rangeB = '';
if (strpos($pRange, ':') === false) {
$rangeA = $pRange;
$rangeB = $pRange;
} else {
list($rangeA, $rangeB) = explode(':', $pRange);
}
// Calculate range outer borders
$rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
$rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB);
// Translate column into index
$rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
$rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
// Translate properties
$myColumn = PHPExcel_Cell::columnIndexFromString($this->getColumn()) - 1;
$myRow = $this->getRow();
// Verify if cell is in range
return (
($rangeStart[0] <= $myColumn && $rangeEnd[0] >= $myColumn) &&
($rangeStart[1] <= $myRow && $rangeEnd[1] >= $myRow)
);
}

+ Here is the call graph for this function:

static PHPExcel_Cell::rangeDimension (   $pRange = 'A1:A1')
static

Calculate range dimension.

Parameters
string$pRangeCell range (e.g. A1:A1)
Returns
array Range dimension (width, height)

Definition at line 583 of file Cell.php.

References columnIndexFromString(), and coordinateFromString().

Referenced by PHPExcel_Writer_HTML\_generateRow().

:A1')
{
// Uppercase coordinate
$pRange = strtoupper($pRange);
// Extract range
$rangeA = '';
$rangeB = '';
if (strpos($pRange, ':') === false) {
$rangeA = $pRange;
$rangeB = $pRange;
} else {
list($rangeA, $rangeB) = explode(':', $pRange);
}
// Calculate range outer borders
$rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
$rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB);
// Translate column into index
$rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]);
$rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]);
return array( ($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1) );
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Cell::rebindParent ( PHPExcel_Worksheet  $parent)

Re-bind parent.

Parameters
PHPExcel_Worksheet$parent
Returns
PHPExcel_Cell

Definition at line 439 of file Cell.php.

{
$this->_parent = $parent;
return $this;
}
PHPExcel_Cell::setCalculatedValue (   $pValue = null)

Set calculated value (used for caching)

Parameters
mixed$pValueValue
Returns
PHPExcel_Cell

Definition at line 291 of file Cell.php.

{
if (!is_null($pValue)) {
$this->_calculatedValue = $pValue;
}
return $this;
}
PHPExcel_Cell::setDataType (   $pDataType = PHPExcel_Cell_DataType::TYPE_STRING)

Set cell data type.

Parameters
string$pDataType
Returns
PHPExcel_Cell

Definition at line 325 of file Cell.php.

{
$this->_dataType = $pDataType;
return $this;
}
PHPExcel_Cell::setDataValidation ( PHPExcel_Cell_DataValidation  $pDataValidation = null)

Set Data validation.

Parameters
PHPExcel_Cell_DataValidation$pDataValidation
Exceptions
Exception
Returns
PHPExcel_Cell

Definition at line 367 of file Cell.php.

References getCoordinate().

{
if (!isset($this->_parent)) {
throw new Exception('Cannot set data validation for cell that is not bound to a worksheet');
}
$this->_parent->setDataValidation($this->getCoordinate(), $pDataValidation);
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Cell::setHyperlink ( PHPExcel_Cell_Hyperlink  $pHyperlink = null)

Set Hyperlink.

Parameters
PHPExcel_Cell_Hyperlink$pHyperlink
Exceptions
Exception
Returns
PHPExcel_Cell

Definition at line 414 of file Cell.php.

References getCoordinate().

{
if (!isset($this->_parent)) {
throw new Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
}
$this->_parent->setHyperlink($this->getCoordinate(), $pHyperlink);
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Cell::setValue (   $pValue = null)

Set cell value.

This clears the cell formula.

Parameters
mixed$pValueValue
Returns
PHPExcel_Cell

Definition at line 215 of file Cell.php.

{
if (!self::getValueBinder()->bindValue($this, $pValue)) {
throw new Exception("Value could not be bound to cell.");
}
return $this;
}
static PHPExcel_Cell::setValueBinder ( PHPExcel_Cell_IValueBinder  $binder = null)
static

Set value binder to use.

Parameters
PHPExcel_Cell_IValueBinder$binder
Exceptions
Exception

Definition at line 757 of file Cell.php.

{
if (is_null($binder)) {
throw new Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly.");
}
self::$_valueBinder = $binder;
}
PHPExcel_Cell::setValueExplicit (   $pValue = null,
  $pDataType = PHPExcel_Cell_DataType::TYPE_STRING 
)

Set cell value (with explicit data type given)

Parameters
mixed$pValueValue
string$pDataTypeExplicit data type
Returns
PHPExcel_Cell

Definition at line 230 of file Cell.php.

References PHPExcel_Shared_String\Substring(), and PHPExcel_Cell_DataType\TYPE_STRING.

Referenced by PHPExcel_Cell_DefaultValueBinder\bindValue(), PHPExcel_Cell_AdvancedValueBinder\bindValue(), and PHPExcel_RichText\setParent().

{
// check strings that they are ok
// TODO: fix also for RichText
if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING && !($pValue instanceof PHPExcel_RichText)) {
// string must never be longer than 32,767 characters, truncate if necessary
$pValue = PHPExcel_Shared_String::Substring($pValue, 0, 32767);
// we require that newline is represented as "\n" in core, not as "\r\n" or "\r"
$pValue = str_replace(array("\r\n", "\r"), "\n", $pValue);
}
$this->_value = $pValue;
$this->_dataType = $pDataType;
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Cell::setXfIndex (   $pValue = 0)

Set index to cellXf.

Parameters
int$pValue
Returns
PHPExcel_Cell

Definition at line 795 of file Cell.php.

{
$this->_xfIndex = $pValue;
return $this;
}
static PHPExcel_Cell::splitRange (   $pRange = 'A1:A1')
static

Split range into coordinate strings.

Parameters
string$pRange
Returns
array Array containg one or more arrays containing one or two coordinate strings

Definition at line 544 of file Cell.php.

Referenced by PHPExcel_Writer_HTML\_generateRow(), PHPExcel_Writer_Excel5_Worksheet\_storeMergedCells(), PHPExcel_Writer_Excel5_Workbook\_storeNames(), PHPExcel_ReferenceHelper\_updateCellRange(), PHPExcel_Writer_Excel5_Workbook\_writeAllDefinedNamesBiff8(), PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange(), extractAllCellReferencesInRange(), and PHPExcel_Worksheet\setXSelectedCells().

:A1')
{
$exploded = explode(',', $pRange);
for ($i = 0; $i < count($exploded); ++$i) {
$exploded[$i] = explode(':', $exploded[$i]);
}
return $exploded;
}

+ Here is the caller graph for this function:

static PHPExcel_Cell::stringFromColumnIndex (   $pColumnIndex = 0)
static

String from columnindex.

Parameters
int$pColumnIndexColumn index (base 0 !!!)
Returns
string

Definition at line 640 of file Cell.php.

Referenced by PHPExcel_Writer_HTML\_generateRow(), PHPExcel_Writer_Excel5_Worksheet\_positionImage(), PHPExcel_Reader_Excel5\_readBIFF5CellRangeAddressFixed(), PHPExcel_Reader_Excel5\_readBIFF8CellAddress(), PHPExcel_Reader_Excel5\_readBIFF8CellAddressB(), PHPExcel_Reader_Excel5\_readBIFF8CellRangeAddress(), PHPExcel_Reader_Excel5\_readBIFF8CellRangeAddressFixed(), PHPExcel_Reader_Excel5\_readBlank(), PHPExcel_Reader_Excel5\_readBoolErr(), PHPExcel_Reader_Excel5_Escher\_readClientAnchor(), PHPExcel_Reader_Excel5\_readFormula(), PHPExcel_Reader_Excel5\_readLabel(), PHPExcel_Reader_Excel5\_readLabelSst(), PHPExcel_Reader_Excel5\_readMulBlank(), PHPExcel_Reader_Excel5\_readMulRk(), PHPExcel_Reader_Excel5\_readNumber(), PHPExcel_Reader_Excel5\_readPane(), PHPExcel_Reader_Excel5\_readRk(), PHPExcel_ReferenceHelper\_updateSingleCellReference(), PHPExcel_Style\applyFromArray(), PHPExcel_Calculation_Functions\CELL_ADDRESS(), PHPExcel_Worksheet\cellExistsByColumnAndRow(), PHPExcel_Writer_Excel5_Worksheet\close(), PHPExcel_Worksheet\duplicateStyle(), extractAllCellReferencesInRange(), PHPExcel_Worksheet\freezePaneByColumnAndRow(), PHPExcel_Worksheet\fromArray(), PHPExcel_Worksheet\getCellByColumnAndRow(), PHPExcel_Worksheet\getColumnDimensionByColumn(), PHPExcel_Worksheet\getCommentByColumnAndRow(), PHPExcel_Shared_Excel5\getDistanceX(), PHPExcel_Worksheet\getHighestColumn(), PHPExcel_Worksheet\getStyleByColumnAndRow(), PHPExcel_ReferenceHelper\insertNewBefore(), PHPExcel_Worksheet\insertNewColumnBeforeByIndex(), PHPExcel_Reader_Excel2007\load(), PHPExcel_Reader_CSV\loadIntoExisting(), PHPExcel_Worksheet\mergeCellsByColumnAndRow(), PHPExcel_Calculation_Functions\OFFSET(), PHPExcel_Shared_Excel5\oneAnchor2twoAnchor(), PHPExcel_Worksheet\protectCellsByColumnAndRow(), PHPExcel_Worksheet\removeColumn(), PHPExcel_Worksheet\removeColumnByIndex(), PHPExcel_Worksheet\setAutoFilterByColumnAndRow(), PHPExcel_Worksheet\setBreakByColumnAndRow(), PHPExcel_Worksheet\setCellValueByColumnAndRow(), PHPExcel_Worksheet\setCellValueExplicitByColumnAndRow(), PHPExcel_Worksheet_PageSetup\setPrintAreaByColumnAndRow(), PHPExcel_Worksheet\setSelectedCellByColumnAndRow(), PHPExcel_Worksheet\unmergeCellsByColumnAndRow(), and PHPExcel_Worksheet\unprotectCellsByColumnAndRow().

{
// Determine column string
if ($pColumnIndex < 26) {
return chr(65 + $pColumnIndex);
}
return PHPExcel_Cell::stringFromColumnIndex((int)($pColumnIndex / 26) -1).chr(65 + $pColumnIndex%26) ;
}

+ Here is the caller graph for this function:

Field Documentation

PHPExcel_Cell::$_calculatedValue = null
private

Definition at line 104 of file Cell.php.

Referenced by getCalculatedValue(), and getOldCalculatedValue().

PHPExcel_Cell::$_column
private

Definition at line 83 of file Cell.php.

PHPExcel_Cell::$_dataType
private

Definition at line 111 of file Cell.php.

Referenced by getDataType().

PHPExcel_Cell::$_parent
private

Definition at line 118 of file Cell.php.

Referenced by getParent().

PHPExcel_Cell::$_row
private

Definition at line 90 of file Cell.php.

Referenced by getCoordinate(), and getRow().

PHPExcel_Cell::$_value
private

Definition at line 97 of file Cell.php.

Referenced by getCalculatedValue(), and getValue().

PHPExcel_Cell::$_valueBinder = null
staticprivate

Definition at line 76 of file Cell.php.

Referenced by getValueBinder().

PHPExcel_Cell::$_xfIndex
private

Definition at line 125 of file Cell.php.

Referenced by getXfIndex().


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