public registerStyle ( |
||
$style | The style to be registered | |
Résultat | The registered style, updated with an internal ID. |
public function registerStyle($style)
{
$serializedStyle = $style->serialize();
if (!$this->hasStyleAlreadyBeenRegistered($style)) {
$nextStyleId = count($this->serializedStyleToStyleIdMappingTable);
$style->setId($nextStyleId);
$this->serializedStyleToStyleIdMappingTable[$serializedStyle] = $nextStyleId;
$this->styleIdToStyleMappingTable[$nextStyleId] = $style;
}
return $this->getStyleFromSerializedStyle($serializedStyle);
}
/** * XLSX specific operations on the registered styles * * @param \Box\Spout\Writer\Style\Style $style * @return \Box\Spout\Writer\Style\Style */ public function registerStyle($style) { $registeredStyle = parent::registerStyle($style); $this->registerFill($registeredStyle); $this->registerBorder($registeredStyle); return $registeredStyle; }