private function formatGs1128() {
        $formatedText = '~F1';
        $formatedLabel = '';
        $c = count($this->identifiersId);

        for ($i = 0; $i < $c; $i++) {
            if ($i > 0) {
                $formatedLabel .= ' ';
            }

            if ($this->identifiersId[$i] !== null) {
                $formatedLabel .= '(' . $this->identifiersId[$i] . ')';
            }

            $formatedText .= $this->identifiersId[$i];

            $formatedLabel .= $this->identifiersContent[$i];
            $formatedText .= $this->identifiersContent[$i];

            if (isset($this->identifiersAi[$this->identifiersId[$i]])) {
                $ai_data = $this->identifiersAi[$this->identifiersId[$i]];
            } elseif (isset($this->identifiersId[$i][3])) {
                $identifierWithVar = substr($this->identifiersId[$i], 0, -1) . 'y';
                $ai_data = isset($this->identifiersAi[$identifierWithVar]) ? $this->identifiersAi[$identifierWithVar] : null;
            } else {
                $ai_data = null;
            }

            /* We'll check if we need to add a ~F1 (<GS>) char */
            /* If we use the legacy mode, we always add a ~F1 (<GS>) char between AIs */
            if ($ai_data !== null) {
                if ((strlen($this->identifiersContent[$i]) < $ai_data[self::MAXLENGTH] && ($i + 1) !== $c) || (!$this->strictMode && ($i + 1) !== $c)) {
                    $formatedText .= '~F1';
                }
            } elseif ($this->allowsUnknownIdentifier && $this->identifiersId[$i] === null && ($i + 1) !== $c) {
                /* If this id is unknown, we add a ~F1 (<GS>) char */
                $formatedText .= '~F1';
            }
        }

        if ($this->noLengthLimit === false && (strlen(str_replace('~F1', chr(29), $formatedText)) - 1) > self::MAX_GS1128_CHARS) {
            throw new CINParseException('gs1128', 'The barcode can\'t contain more than ' . self::MAX_GS1128_CHARS . ' characters.');
        }

        $this->label = $formatedLabel;
        return $formatedText;
    }
private function formatGs1128() {
        $formatedText = '~F1';
        $formatedLabel = '';
        $c = count($this->identifiersId);

        for ($i = 0; $i < $c; $i++) {
            if ($i > 0) {
                $formatedLabel .= ' ';
            }

            if ($this->identifiersId[$i] !== null) {
                $formatedLabel .= '(' . $this->identifiersId[$i] . ')';
            }

            $formatedText .= $this->identifiersId[$i];

            $formatedLabel .= $this->identifiersContent[$i];
            $formatedText .= $this->identifiersContent[$i];

            if (isset($this->identifiersAi[$this->identifiersId[$i]])) {
                $ai_data = $this->identifiersAi[$this->identifiersId[$i]];
            } elseif (isset($this->identifiersId[$i][3])) {
                $identifierWithVar = substr($this->identifiersId[$i], 0, -1) . 'y';
                $ai_data = isset($this->identifiersAi[$identifierWithVar]) ? $this->identifiersAi[$identifierWithVar] : null;
            } else {
                $ai_data = null;
            }

            /* We'll check if we need to add a ~F1 (<GS>) char */
            /* If we use the legacy mode, we always add a ~F1 (<GS>) char between AIs */
            if ($ai_data !== null) {
                if ((strlen($this->identifiersContent[$i]) < $ai_data[self::MAXLENGTH] && ($i + 1) !== $c) || (!$this->strictMode && ($i + 1) !== $c)) {
                    $formatedText .= '~F1';
                }
            } elseif ($this->allowsUnknownIdentifier && $this->identifiersId[$i] === null && ($i + 1) !== $c) {
                /* If this id is unknown, we add a ~F1 (<GS>) char */
                $formatedText .= '~F1';
            }
        }

        if ($this->noLengthLimit === false && (strlen(str_replace('~F1', chr(29), $formatedText)) - 1) > self::MAX_GS1128_CHARS) {
            throw new CINParseException('gs1128', 'The barcode can\'t contain more than ' . self::MAX_GS1128_CHARS . ' characters.');
        }

        $this->label = $formatedLabel;
        return $formatedText;
    }
private function formatGs1128 ( ) { $ formatedText = '~F1' ; $ formatedLabel = '' ; $ c = count ( $ this -> identifiersId ) ; for ( $ i = 0 ; $ i < $ c ; $ i ++ ) { if ( $ i > 0 ) { $ formatedLabel .= ' ' ; } if ( $ this -> identifiersId [ $ i ] !== null ) { $ formatedLabel .= '(' . $ this -> identifiersId [ $ i ] . ')' ; } $ formatedText .= $ this -> identifiersId [ $ i ] ; $ formatedLabel .= $ this -> identifiersContent [ $ i ] ; $ formatedText .= $ this -> identifiersContent [ $ i ] ; if ( isset ( $ this -> identifiersAi [ $ this -> identifiersId [ $ i ] ] ) ) { $ ai_data = $ this -> identifiersAi [ $ this -> identifiersId [ $ i ] ] ; } elseif ( isset ( $ this -> identifiersId [ $ i ] [ 3 ] ) ) { $ identifierWithVar = substr ( $ this -> identifiersId [ $ i ] , 0 , - 1 ) . 'y' ; $ ai_data = isset ( $ this -> identifiersAi [ $ identifierWithVar ] ) ? $ this -> identifiersAi [ $ identifierWithVar ] : null ; } else { $ ai_data = null ; } /* We'll check if we need to add a ~F1 (<GS>) char */ /* If we use the legacy mode, we always add a ~F1 (<GS>) char between AIs */ if ( $ ai_data !== null ) { if ( ( strlen ( $ this -> identifiersContent [ $ i ] ) < $ ai_data [ self :: MAXLENGTH ] && ( $ i + 1 ) !== $ c ) || ( ! $ this -> strictMode && ( $ i + 1 ) !== $ c ) ) { $ formatedText .= '~F1' ; } } elseif ( $ this -> allowsUnknownIdentifier && $ this -> identifiersId [ $ i ] === null && ( $ i + 1 ) !== $ c ) { /* If this id is unknown, we add a ~F1 (<GS>) char */ $ formatedText .= '~F1' ; } } if ( $ this -> noLengthLimit === false && ( strlen ( str_replace ( '~F1' , chr ( 29 ) , $ formatedText ) ) - 1 ) > self :: MAX_GS1128_CHARS ) { throw new CINParseException ( 'gs1128' , 'The barcode can\'t contain more than ' . self :: MAX_GS1128_CHARS . ' characters.' ) ; } $ this -> label = $ formatedLabel ; return $ formatedText ; }
Formats data for gs1-128.

@return string
Formats data for gs1 - 128 .