public function AlphabetPages()
    {
        $query = new SQLSelect();
        $pages = new ArrayList();

        $sortOn = $this->config()->sort_on;
        //Build an SQL query to get all the letters that people start with
        $query->select(array("Left($sortOn, 1) AS Letter"));
        $query->from($this->getRecordType());
        $query->groupBy(array('Letter'));
        $lettersFound = $query->execute()->column();

        $pages->push(
            new ArrayData(
                array(
                    'Letter' => 'All',
                    'Link' => $this->Link(),
                    'CurrentBool' => !isset($_GET['Letter']),
                )
            )
        );

        foreach (array(
                     'A',
                     'B',
                     'C',
                     'D',
                     'E',
                     'F',
                     'G',
                     'H',
                     'I',
                     'J',
                     'K',
                     'L',
                     'M',
                     'N',
                     'O',
                     'P',
                     'Q',
                     'R',
                     'S',
                     'T',
                     'U',
                     'V',
                     'W',
                     'X',
                     'Y',
                     'Z',
                     '0'
                 ) as $letter) {

            $letterFound = in_array($letter, $lettersFound);

            $pages->push(
                new ArrayData(
                    array(
                        'Letter' => $letter,
                        'Link' => $letterFound ? $this->Link() . '?letter=' . $letter : false,
                        'CurrentBool' => isset($_GET['letter']) && $_GET['letter'] == $letter,
                    )

                )
            );

        }
        return $pages;
    }
public function AlphabetPages()
    {
        $query = new SQLSelect();
        $pages = new ArrayList();

        $sortOn = $this->config()->sort_on;
        //Build an SQL query to get all the letters that people start with
        $query->select(array("Left($sortOn, 1) AS Letter"));
        $query->from($this->getRecordType());
        $query->groupBy(array('Letter'));
        $lettersFound = $query->execute()->column();

        $pages->push(
            new ArrayData(
                array(
                    'Letter' => 'All',
                    'Link' => $this->Link(),
                    'CurrentBool' => !isset($_GET['Letter']),
                )
            )
        );

        foreach (array(
                     'A',
                     'B',
                     'C',
                     'D',
                     'E',
                     'F',
                     'G',
                     'H',
                     'I',
                     'J',
                     'K',
                     'L',
                     'M',
                     'N',
                     'O',
                     'P',
                     'Q',
                     'R',
                     'S',
                     'T',
                     'U',
                     'V',
                     'W',
                     'X',
                     'Y',
                     'Z',
                     '0'
                 ) as $letter) {

            $letterFound = in_array($letter, $lettersFound);

            $pages->push(
                new ArrayData(
                    array(
                        'Letter' => $letter,
                        'Link' => $letterFound ? $this->Link() . '?letter=' . $letter : false,
                        'CurrentBool' => isset($_GET['letter']) && $_GET['letter'] == $letter,
                    )

                )
            );

        }
        return $pages;
    }
public function AlphabetPages ( ) { $ query = new SQLSelect ( ) ; $ pages = new ArrayList ( ) ; $ sortOn = $ this -> config ( ) -> sort_on ; //Build an SQL query to get all the letters that people start with $ query -> select ( array ( "Left($sortOn, 1) AS Letter" ) ) ; $ query -> from ( $ this -> getRecordType ( ) ) ; $ query -> groupBy ( array ( 'Letter' ) ) ; $ lettersFound = $ query -> execute ( ) -> column ( ) ; $ pages -> push ( new ArrayData ( array ( 'Letter' => 'All' , 'Link' => $ this -> Link ( ) , 'CurrentBool' => ! isset ( $ _GET [ 'Letter' ] ) , ) ) ) ; foreach ( array ( 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' , '0' ) as $ letter ) { $ letterFound = in_array ( $ letter , $ lettersFound ) ; $ pages -> push ( new ArrayData ( array ( 'Letter' => $ letter , 'Link' => $ letterFound ? $ this -> Link ( ) . '?letter=' . $ letter : false , 'CurrentBool' => isset ( $ _GET [ 'letter' ] ) && $ _GET [ 'letter' ] == $ letter , ) ) ) ; } return $ pages ; }
Generates a ArrayList of anonymous objects that can be used
to create an alphabet menu for all the items, linking only
when there are items begining with the letter, and providing
an indication of whether it is currently selected or not

@return ArrayList
Generates a ArrayList of anonymous objects that can be used to create an alphabet menu for all the items linking only when there are items begining with the letter and providing an indication of whether it is currently selected or not