Bind value to a cell

@param  PHPExcel_Cell  $cell  Cell to bind value to
@param  mixed $value          Value to bind in cell
@return boolean
778293
public function bindValue(PHPExcel_Cell $cell, $value = null)
    {
        // sanitize UTF-8 strings
        if (is_string($value)) {
            $value = PHPExcel_Shared_String::SanitizeUTF8($value);
        }

        // Find out data type
        $dataType = parent::dataTypeForValue($value);

        // Style logic - strings
        if ($dataType === PHPExcel_Cell_DataType::TYPE_STRING && !$value instanceof PHPExcel_RichText) {
            //    Test for booleans using locale-setting
            if ($value == PHPExcel_Calculation::getTRUE()) {
                $cell->setValueExplicit( TRUE, PHPExcel_Cell_DataType::TYPE_BOOL);
                return true;
            } elseif($value == PHPExcel_Calculation::getFALSE()) {
                $cell->setValueExplicit( FALSE, PHPExcel_Cell_DataType::TYPE_BOOL);
                return true;
            }

            // Check for number in scientific format
            if (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) {
                $cell->setValueExplicit( (float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                return true;
            }

            // Check for fraction
            if (preg_match('/^([+-]?)\s*([0-9]+)\s?\/\s*([0-9]+)$/', $value, $matches)) {
                // Convert value to number
                $value = $matches[2] / $matches[3];
                if ($matches[1] == '-') $value = 0 - $value;
                $cell->setValueExplicit( (float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                // Set style
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getNumberFormat()->setFormatCode( '??/??' );
                return true;
            } elseif (preg_match('/^([+-]?)([0-9]*) +([0-9]*)\s?\/\s*([0-9]*)$/', $value, $matches)) {
                // Convert value to number
                $value = $matches[2] + ($matches[3] / $matches[4]);
                if ($matches[1] == '-') $value = 0 - $value;
                $cell->setValueExplicit( (float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                // Set style
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getNumberFormat()->setFormatCode( '# ??/??' );
                return true;
            }

            // Check for percentage
            if (preg_match('/^\-?[0-9]*\.?[0-9]*\s?\%$/', $value)) {
                // Convert value to number
                $value = (float) str_replace('%', '', $value) / 100;
                $cell->setValueExplicit( $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                // Set style
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00 );
                return true;
            }

            // Check for currency
            $currencyCode = PHPExcel_Shared_String::getCurrencyCode();
            $decimalSeparator = PHPExcel_Shared_String::getDecimalSeparator();
            $thousandsSeparator = PHPExcel_Shared_String::getThousandsSeparator();
            if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) {
                // Convert value to number
                $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value));
                $cell->setValueExplicit( $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                // Set style
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getNumberFormat()->setFormatCode(
                        str_replace('$', $currencyCode, PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE )
                    );
                return true;
            } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) {
                // Convert value to number
                $value = (float) trim(str_replace(array('$',','), '', $value));
                $cell->setValueExplicit( $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                // Set style
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE );
                return true;
            }

            // Check for time without seconds e.g. '9:45', '09:45'
            if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) {
                // Convert value to number
                list($h, $m) = explode(':', $value);
                $days = $h / 24 + $m / 1440;
                $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                // Set style
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3 );
                return true;
            }

            // Check for time with seconds '9:45:59', '09:45:59'
            if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) {
                // Convert value to number
                list($h, $m, $s) = explode(':', $value);
                $days = $h / 24 + $m / 1440 + $s / 86400;
                // Convert value to number
                $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                // Set style
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4 );
                return true;
            }

            // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10'
            if (($d = PHPExcel_Shared_Date::stringToExcel($value)) !== false) {
                // Convert value to number
                $cell->setValueExplicit($d, PHPExcel_Cell_DataType::TYPE_NUMERIC);
                // Determine style. Either there is a time part or not. Look for ':'
                if (strpos($value, ':') !== false) {
                    $formatCode = 'yyyy-mm-dd h:mm';
                } else {
                    $formatCode = 'yyyy-mm-dd';
                }
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getNumberFormat()->setFormatCode($formatCode);
                return true;
            }

            // Check for newline character "\n"
            if (strpos($value, "\n") !== FALSE) {
                $value = PHPExcel_Shared_String::SanitizeUTF8($value);
                $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);
                // Set style
                $cell->getWorksheet()->getStyle( $cell->getCoordinate() )
                    ->getAlignment()->setWrapText(TRUE);
                return true;
            }
        }

        // Not bound yet? Use parent...
        return parent::bindValue($cell, $value);
    }
784720
public function setValue($value)
    {
        if ($this->value instanceof Binding && !($value instanceof Binding)) {
            $this->value->setValue($value);
        } else {
            $this->value = $value;
        }
    }
100945
public function setCellValue($cellName, $valueType, $value)
    {
        //check whether worksheet name is set or not
        if ($this->worksheetName == '')
            throw new Exception('Worksheet name not specified');
        $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
            '/worksheets/' . $this->worksheetName . '/cells/' . $cellName . '?value=' . $value . '&type=' . $valueType;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'POST', '', '');
        $json = json_decode($responseStream);
        if ($json->Code == 200)
            return true;
        else
            return false;

    }
213645
function _cellToPackedRowcol($cell)
	{
		$cell = strtoupper($cell);
		list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell);
		if ($col >= 256) {
			throw new PHPExcel_Writer_Exception("Column in: $cell greater than 255");
		}
		if ($row >= 65536) {
			throw new PHPExcel_Writer_Exception("Row in: $cell greater than 65536 ");
		}

		// Set the high bits to indicate if row or col are relative.
		$col |= $col_rel << 14;
		$col |= $row_rel << 15;
		$col = pack('v', $col);

		$row = pack('v', $row);

		return array($row, $col);
	}
624407
private function setCellValue($column, $value)
    {
        $cellValue = $value;

        if (\is_bool($value)) {
            if ($value) {
                $cellValue = 1;
            } else {
                $cellValue = 0;
            }
        }

        $this->getActiveSheet()->setCellValue($column, $cellValue);
    }
871467
public function setValue($value)
	{
		$failure = true;
		switch($this->opration)
		{
			case '==':
				if($value==$this->condition)
					$failure = false;
				break;
			case '>':
				if($value>$this->condition)
					$failure = false;
				break;
			case '>=':
				if($value>=$this->condition)
					$faulure = false;
				break;
			case '<':
				if($value<$this->condition)
					$failure = false;
				break;
			case '<=':
				if($value<=$this->condition)
					$failure = false;
				break;
			case '*':
				if(strpos($value, $this->condition)!==false)
					$failure = false;
				break;
			case '^':
				if(strpos($value, $this->condition)===0)
					$failure = false;
				break;
			case '$':
				if(strrpos($value, $this->condition)==strlen($value)-strlen($this->condition))
					$failure = false;
				break;
			default:
				break;
		}
		if($failure)
			throw $this->getContext()->getModel('ValidationException', 'Form', array(
				array(
					'' => 'condition failed'
				)
			));
		return $value;
	}
427193
private function bindDataType($value)
    {
        switch (true) {
            case is_string($value):
                return PDO::PARAM_STR;
            case is_int($value):
                return PDO::PARAM_INT;
            case is_bool($value):
                return PDO::PARAM_BOOL;
            case is_null($value):
                return PDO::PARAM_NULL;
            default:
                return false;
        }
    }
948614
public function setHex(string $value, int $expire = 0): bool
    {
        return $this->setRaw(pack('H*', $value), $expire);
    }
646712
public function set(string $column, $value)
    {
        if (method_exists($this, $this->getAttributeSetMethod($column))) {
            foreach ($this as $row) {
                $row[$column] = $value;
            }

            return $this;
        }

        $this->validateFillableColumn($column);

        foreach (array_keys($this->rows) as $key) {
            $this->setInRow($key, $column, $value);
        }
        unset($row);

        return $this;
    }
511799
public function setCell(Cell $cell)
    {
        $this->cells[(string)$cell->getColumn()] = $cell;
        ksort($this->cells);

        return $this;
    }
984966
public function rebindParent(PHPExcel $parent)
    {
        if ($this->parent !== null) {
            $namedRanges = $this->parent->getNamedRanges();
            foreach ($namedRanges as $namedRange) {
                $parent->addNamedRange($namedRange);
            }

            $this->parent->removeSheetByIndex(
                $this->parent->getIndex($this)
            );
        }
        $this->parent = $parent;

        return $this;
    }
322771
public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = null)
    {
        if (!isset($this->parent)) {
            throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
        }

        $this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);

        return $this->notifyCacheController();
    }
1210011
public function bindValues($values): void
    {
        $params = func_get_args();
        if (isset($params[0]) && is_array($params[0])) {
            $this->bindedValues = new \ArrayObject($params[0]);
        } else {
            $this->bindedValues = new \ArrayObject($params);
        }
    }
638055
public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = NULL)
	{
		if (!isset($this->_parent)) {
			throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet');
		}

		$this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);

		return $this->notifyCacheController();
	}
1059119
public function setValue($value){

        $returnValue = false;

        if(!is_null($value)){
            try{
                $value = new static::$type($value);
                if(!is_null($value)){
                    $this->value = $value;
                    $returnValue = true;
                }
            }catch(DatatypeException $de){
                $type = '('.gettype($value).')';
                if($type == 'object'){
                    $type .= '('.get_class($value).')';
                }
                throw new AttributeException('Cannot assign the value to attribute: '.static::$name.' -> '.$type.' '.$value);
            }
        }

        return $returnValue;
    }
1186347
public function setColumn(string $column, $value)
    {
        $this->table->getColumn($column);

        $this->columnData[$column] = $value;
    }
536743
public static function VALUE($value = '')
    {
        $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);

        if (!is_numeric($value)) {
            $numberValue = str_replace(
                PHPExcel_Shared_String::getThousandsSeparator(),
                '',
                trim($value, " \t\n\r\0\x0B" . PHPExcel_Shared_String::getCurrencyCode())
            );
            if (is_numeric($numberValue)) {
                return (float) $numberValue;
            }

            $dateSetting = PHPExcel_Calculation_Functions::getReturnDateType();
            PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);

            if (strpos($value, ':') !== false) {
                $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($value);
                if ($timeValue !== PHPExcel_Calculation_Functions::VALUE()) {
                    PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
                    return $timeValue;
                }
            }
            $dateValue = PHPExcel_Calculation_DateTime::DATEVALUE($value);
            if ($dateValue !== PHPExcel_Calculation_Functions::VALUE()) {
                PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
                return $dateValue;
            }
            PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);

            return PHPExcel_Calculation_Functions::VALUE();
        }
        return (float) $value;
    }