protected function getListState()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            $list = $this->state->getList();
            $this->limitArray($list);
            return $list;
        }

        if ($this->getParam('country')) {
            $list = $this->state->getList(array('country' => $id));
            $this->limitArray($list);
            return $list;
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->state->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
protected function getListState()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            $list = $this->state->getList();
            $this->limitArray($list);
            return $list;
        }

        if ($this->getParam('country')) {
            $list = $this->state->getList(array('country' => $id));
            $this->limitArray($list);
            return $list;
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->state->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
protected function getListState ( ) { $ id = $ this -> getParam ( 0 ) ; if ( ! isset ( $ id ) ) { $ list = $ this -> state -> getList ( ) ; $ this -> limitArray ( $ list ) ; return $ list ; } if ( $ this -> getParam ( 'country' ) ) { $ list = $ this -> state -> getList ( array ( 'country' => $ id ) ) ; $ this -> limitArray ( $ list ) ; return $ list ; } if ( ! is_numeric ( $ id ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid argument' ) ) ; } $ result = $ this -> state -> get ( $ id ) ; if ( empty ( $ result ) ) { $ this -> errorAndExit ( $ this -> text ( 'Unexpected result' ) ) ; } return array ( $ result ) ; }
Returns an array of country states
@return array
Returns an array of country states