protected function registerBorder($style)
    {
        $styleId = $style->getId();

        if ($style->shouldApplyBorder()) {
            $border = $style->getBorder();
            $serializedBorder = serialize($border);

            $isBorderAlreadyRegistered = isset($this->registeredBorders[$serializedBorder]);

            if ($isBorderAlreadyRegistered) {
                $registeredStyleId = $this->registeredBorders[$serializedBorder];
                $registeredBorderId = $this->styleIdToBorderMappingTable[$registeredStyleId];
                $this->styleIdToBorderMappingTable[$styleId] = $registeredBorderId;
            } else {
                $this->registeredBorders[$serializedBorder] = $styleId;
                $this->styleIdToBorderMappingTable[$styleId] = count($this->registeredBorders);
            }

        } else {
            // If no border should be applied - the mapping is the default border: 0
            $this->styleIdToBorderMappingTable[$styleId] = 0;
        }
    }
protected function registerBorder($style)
    {
        $styleId = $style->getId();

        if ($style->shouldApplyBorder()) {
            $border = $style->getBorder();
            $serializedBorder = serialize($border);

            $isBorderAlreadyRegistered = isset($this->registeredBorders[$serializedBorder]);

            if ($isBorderAlreadyRegistered) {
                $registeredStyleId = $this->registeredBorders[$serializedBorder];
                $registeredBorderId = $this->styleIdToBorderMappingTable[$registeredStyleId];
                $this->styleIdToBorderMappingTable[$styleId] = $registeredBorderId;
            } else {
                $this->registeredBorders[$serializedBorder] = $styleId;
                $this->styleIdToBorderMappingTable[$styleId] = count($this->registeredBorders);
            }

        } else {
            // If no border should be applied - the mapping is the default border: 0
            $this->styleIdToBorderMappingTable[$styleId] = 0;
        }
    }
protected function registerBorder ( $ style ) { $ styleId = $ style -> getId ( ) ; if ( $ style -> shouldApplyBorder ( ) ) { $ border = $ style -> getBorder ( ) ; $ serializedBorder = serialize ( $ border ) ; $ isBorderAlreadyRegistered = isset ( $ this -> registeredBorders [ $ serializedBorder ] ) ; if ( $ isBorderAlreadyRegistered ) { $ registeredStyleId = $ this -> registeredBorders [ $ serializedBorder ] ; $ registeredBorderId = $ this -> styleIdToBorderMappingTable [ $ registeredStyleId ] ; $ this -> styleIdToBorderMappingTable [ $ styleId ] = $ registeredBorderId ; } else { $ this -> registeredBorders [ $ serializedBorder ] = $ styleId ; $ this -> styleIdToBorderMappingTable [ $ styleId ] = count ( $ this -> registeredBorders ) ; } } else { // If no border should be applied - the mapping is the default border: 0 $ this -> styleIdToBorderMappingTable [ $ styleId ] = 0 ; } }
Register a border definition

@param \Box\Spout\Writer\Style\Style $style
Register a border definition