odata/library/ODataProducer/UriProcessor/QueryProcessor/ExpandProjectionParser/ExpandProjectionParser.php
/**
     * Read expand or select clause.
     * 
     * @param string  $value    expand or select clause to read.
     * @param boolean $isSelect true means $value is value of select clause
     *                          else value of expand clause.
     * 
     * @return array(array) An array of 'PathSegment's, each of which is array
     *                      of 'SubPathSegment's
     */
Read expand or select clause.

@param string  $value    expand or select clause to read.
@param boolean $isSelect true means $value is value of select clause
else value of expand clause.

@return array(array) An array of 'PathSegment's, each of which is array
of 'SubPathSegment's
Read expand or select clause . @param string $value expand or select clause to read . @param boolean $isSelect true means $value is value of select clause else value of expand clause . @return array ( array ) An array of ' PathSegment ' s each of which is array of ' SubPathSegment ' s
private function _readExpandOrSelect($value, $isSelect)
    {
        $pathSegments = array();
        $lexer = new ExpressionLexer($value);
        $i = 0;
        while ($lexer->getCurrentToken()->Id != ExpressionTokenId::END) {
            $lastSegment = false;
            if ($isSelect 
                && $lexer->getCurrentToken()->Id == ExpressionTokenId::STAR
            ) {
                $lastSegment = true;
                $subPathSegment = $lexer->getCurrentToken()->Text;
                $lexer->nextToken();
            } else {
                $subPathSegment = $lexer->readDottedIdentifier();
            }
            if (!array_key_exists($i, $pathSegments)) {
                $pathSegments[$i] = array();
            }
            $pathSegments[$i][] = $subPathSegment;
            $tokenId = $lexer->getCurrentToken()->Id;
            if ($tokenId != ExpressionTokenId::END) {
                if ($lastSegment || $tokenId != ExpressionTokenId::SLASH) {
                    $lexer->validateToken(ExpressionTokenId::COMMA);
                    $i++;
                }
                $lexer->nextToken();
            }
        }
        return $pathSegments;
    }
private function _readExpandOrSelect ( $ value , $ isSelect ) { $ pathSegments = array ( ) ; $ lexer = new ExpressionLexer ( $ value ) ; $ i = 0 ; while ( $ lexer -> getCurrentToken ( ) -> Id != ExpressionTokenId :: END ) { $ lastSegment = false ; if ( $ isSelect && $ lexer -> getCurrentToken ( ) -> Id == ExpressionTokenId :: STAR ) { $ lastSegment = true ; $ subPathSegment = $ lexer -> getCurrentToken ( ) -> Text ; $ lexer -> nextToken ( ) ; } else { $ subPathSegment = $ lexer -> readDottedIdentifier ( ) ; } if ( ! array_key_exists ( $ i , $ pathSegments ) ) { $ pathSegments [ $ i ] = array ( ) ; } $ pathSegments [ $ i ] [ ] = $ subPathSegment ; $ tokenId = $ lexer -> getCurrentToken ( ) -> Id ; if ( $ tokenId != ExpressionTokenId :: END ) { if ( $ lastSegment || $ tokenId != ExpressionTokenId :: SLASH ) { $ lexer -> validateToken ( ExpressionTokenId :: COMMA ) ; $ i ++ ; } $ lexer -> nextToken ( ) ; } } return $ pathSegments ; }
Read expand or select clause.
Read expand or select clause .