private function parseGs1128($text) {
        /* We format correctly what the user gives */
        if (is_array($text)) {
            $formatArray = array();
            foreach ($text as $content) {
                if (is_array($content)) { /* double array */
                    if (count($content) === 2) {
                        if (is_array($content[self::ID]) || is_array($content[self::CONTENT])) {
                            throw new CINParseException('gs1128', 'Double arrays can\'t contain arrays.');
                        } else {
                            $formatArray[] = '(' . $content[self::ID] . ')' . $content[self::CONTENT];
                        }
                    } else {
                        throw new CINParseException('gs1128', 'Double arrays must contain 2 values.');
                    }
                } else { /* simple array */
                    $formatArray[] = $content;
                }
            }

            unset($text);
            $text = $formatArray;
        } else { /* string */
            $text = array($text);
        }

        $textCount = count($text);
        for ($cmpt = 0; $cmpt < $textCount; $cmpt++) {
            /* We parse the content of the array */
            if (!$this->parseContent($text[$cmpt])) {
                return;
            }
        }

        return $this->formatGs1128();
    }
private function parseGs1128($text) {
        /* We format correctly what the user gives */
        if (is_array($text)) {
            $formatArray = array();
            foreach ($text as $content) {
                if (is_array($content)) { /* double array */
                    if (count($content) === 2) {
                        if (is_array($content[self::ID]) || is_array($content[self::CONTENT])) {
                            throw new CINParseException('gs1128', 'Double arrays can\'t contain arrays.');
                        } else {
                            $formatArray[] = '(' . $content[self::ID] . ')' . $content[self::CONTENT];
                        }
                    } else {
                        throw new CINParseException('gs1128', 'Double arrays must contain 2 values.');
                    }
                } else { /* simple array */
                    $formatArray[] = $content;
                }
            }

            unset($text);
            $text = $formatArray;
        } else { /* string */
            $text = array($text);
        }

        $textCount = count($text);
        for ($cmpt = 0; $cmpt < $textCount; $cmpt++) {
            /* We parse the content of the array */
            if (!$this->parseContent($text[$cmpt])) {
                return;
            }
        }

        return $this->formatGs1128();
    }
private function parseGs1128 ( $ text ) { /* We format correctly what the user gives */ if ( is_array ( $ text ) ) { $ formatArray = array ( ) ; foreach ( $ text as $ content ) { if ( is_array ( $ content ) ) { /* double array */ if ( count ( $ content ) === 2 ) { if ( is_array ( $ content [ self :: ID ] ) || is_array ( $ content [ self :: CONTENT ] ) ) { throw new CINParseException ( 'gs1128' , 'Double arrays can\'t contain arrays.' ) ; } else { $ formatArray [ ] = '(' . $ content [ self :: ID ] . ')' . $ content [ self :: CONTENT ] ; } } else { throw new CINParseException ( 'gs1128' , 'Double arrays must contain 2 values.' ) ; } } else { /* simple array */ $ formatArray [ ] = $ content ; } } unset ( $ text ) ; $ text = $ formatArray ; } else { /* string */ $ text = array ( $ text ) ; } $ textCount = count ( $ text ) ; for ( $ cmpt = 0 ; $ cmpt < $ textCount ; $ cmpt ++ ) { /* We parse the content of the array */ if ( ! $ this -> parseContent ( $ text [ $ cmpt ] ) ) { return ; } } return $ this -> formatGs1128 ( ) ; }
Parses the text to gs1-128.

@param mixed $text
@return mixed
Parses the text to gs1 - 128 .