public function serialize()
{
// In order to be able to properly compare style, set static ID value
$currentId = $this->id;
$this->setId(0);
$serializedStyle = serialize($this);
$this->setId($currentId);
return $serializedStyle;
}
/** * Returns whether the given style has already been registered. * * @param \Box\Spout\Writer\Style\Style $style * @return bool */ protected function hasStyleAlreadyBeenRegistered($style) { $serializedStyle = $style->serialize(); // Using isset here because it is way faster than array_key_exists... return isset($this->serializedStyleToStyleIdMappingTable[$serializedStyle]); }