protected function getCellXML($rowIndex, $cellNumber, $cellValue, $styleId)
    {
        $columnIndex = CellHelper::getCellIndexFromColumnIndex($cellNumber);
        $cellXML = '<c r="' . $columnIndex . $rowIndex . '"';
        $cellXML .= ' s="' . $styleId . '"';

        if (CellHelper::isNonEmptyString($cellValue)) {
            $cellXML .= $this->getCellXMLFragmentForNonEmptyString($cellValue);
        } else if (CellHelper::isBoolean($cellValue)) {
            $cellXML .= ' t="b"><v>' . intval($cellValue) . '</v></c>';
        } else if (CellHelper::isNumeric($cellValue)) {
            $cellXML .= '><v>' . $cellValue . '</v></c>';
        } else if (empty($cellValue)) {
            if ($this->styleHelper->shouldApplyStyleOnEmptyCell($styleId)) {
                $cellXML .= '/>';
            } else {
                // don't write empty cells that do no need styling
                // NOTE: not appending to $cellXML is the right behavior!!
                $cellXML = '';
            }
        } else {
            throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . gettype($cellValue));
        }

        return $cellXML;
    }
protected function getCellXML($rowIndex, $cellNumber, $cellValue, $styleId)
    {
        $columnIndex = CellHelper::getCellIndexFromColumnIndex($cellNumber);
        $cellXML = '<c r="' . $columnIndex . $rowIndex . '"';
        $cellXML .= ' s="' . $styleId . '"';

        if (CellHelper::isNonEmptyString($cellValue)) {
            $cellXML .= $this->getCellXMLFragmentForNonEmptyString($cellValue);
        } else if (CellHelper::isBoolean($cellValue)) {
            $cellXML .= ' t="b"><v>' . intval($cellValue) . '</v></c>';
        } else if (CellHelper::isNumeric($cellValue)) {
            $cellXML .= '><v>' . $cellValue . '</v></c>';
        } else if (empty($cellValue)) {
            if ($this->styleHelper->shouldApplyStyleOnEmptyCell($styleId)) {
                $cellXML .= '/>';
            } else {
                // don't write empty cells that do no need styling
                // NOTE: not appending to $cellXML is the right behavior!!
                $cellXML = '';
            }
        } else {
            throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . gettype($cellValue));
        }

        return $cellXML;
    }
protected function getCellXML ( $ rowIndex , $ cellNumber , $ cellValue , $ styleId ) { $ columnIndex = CellHelper :: getCellIndexFromColumnIndex ( $ cellNumber ) ; $ cellXML = '<c r="' . $ columnIndex . $ rowIndex . '"' ; $ cellXML .= ' s="' . $ styleId . '"' ; if ( CellHelper :: isNonEmptyString ( $ cellValue ) ) { $ cellXML .= $ this -> getCellXMLFragmentForNonEmptyString ( $ cellValue ) ; } else if ( CellHelper :: isBoolean ( $ cellValue ) ) { $ cellXML .= ' t="b"><v>' . intval ( $ cellValue ) . '</v></c>' ; } else if ( CellHelper :: isNumeric ( $ cellValue ) ) { $ cellXML .= '><v>' . $ cellValue . '</v></c>' ; } else if ( empty ( $ cellValue ) ) { if ( $ this -> styleHelper -> shouldApplyStyleOnEmptyCell ( $ styleId ) ) { $ cellXML .= '/>' ; } else { // don't write empty cells that do no need styling // NOTE: not appending to $cellXML is the right behavior!! $ cellXML = '' ; } } else { throw new InvalidArgumentException ( 'Trying to add a value with an unsupported type: ' . gettype ( $ cellValue ) ) ; } return $ cellXML ; }
Build and return xml for a single cell.

@param int $rowIndex
@param int $cellNumber
@param mixed $cellValue
@param int $styleId
@return string
@throws InvalidArgumentException If the given value cannot be processed
Build and return xml for a single cell .