/** * Set parent * * @param PHPExcel_Cell $value */ public function setParent(PHPExcel_Cell $value) { // Set parent $this->_parent = $value; // Set parent value $this->_parent->setValue($this); }
/** * Set parent * * @param PHPExcel_Cell $value */ public function setParent(PHPExcel_Cell $value) { // Set parent $this->_parent = $value; // Set parent value $this->_parent->setValue($this); // Verify style information $sheet = $this->_parent->getParent(); $cellFont = $sheet->getStyle($this->_parent->getCoordinate())->getFont(); foreach ($this->getRichTextElements() as $element) { if (!$element instanceof PHPExcel_RichText_Run) { continue; } if ($element->getFont()->getHashCode() == $sheet->getDefaultStyle()->getFont()->getHashCode()) { if ($element->getFont()->getHashCode() != $cellFont->getHashCode()) { $element->setFont(clone $cellFont); } } } }
/** * @param null|int $index * @param null|mixed $value * @param null|array $properties * * @throws \PHPExcel_Exception */ public function start($index = null, $value = null, array $properties = null) { if ($this->sheetWrapper->getObject() === null) { throw new \LogicException(); } if ($index !== null && !is_int($index)) { throw new \InvalidArgumentException(); } if ($index === null) { $this->sheetWrapper->increaseColumn(); } else { $this->sheetWrapper->setColumn($index); } $this->object = $this->sheetWrapper->getObject()->getCellByColumnAndRow($this->sheetWrapper->getColumn(), $this->sheetWrapper->getRow()); if ($value !== null) { $this->object->setValue($value); } if ($properties !== null) { $this->setProperties($properties, $this->mappings); } $this->attributes['value'] = $value; $this->attributes['properties'] = $properties ?: []; }