function formatToArrayStandard($route = null,array $parameters = array()) {
        $links = array(
            'self'  => array('href' => ''),
            'first' => array('href' => ''),
            'last'  => array('href' => ''),
            'next'  => array('href' => ''),
            'previous'  => array('href' => ''),
        );
        $paginator = array(
                        'currentPage' => $this->getCurrentPage(),
                        'maxPerPage' => $this->getMaxPerPage(),
                        'totalPages' => $this->getNbPages(),
                        'totalResults' => $this->getNbResults(),
                    );
        
        $pageResult = $this->getCurrentPageResults();
        if(is_array($pageResult)){
            $results = $pageResult;
        }else{
            $results = $this->getCurrentPageResults()->getArrayCopy();
        }
        return array(
            'links' => $this->getLinks($route,$parameters),
            'meta' => $paginator,
            'data' => $results,
        );
    }
function formatToArrayStandard($route = null,array $parameters = array()) {
        $links = array(
            'self'  => array('href' => ''),
            'first' => array('href' => ''),
            'last'  => array('href' => ''),
            'next'  => array('href' => ''),
            'previous'  => array('href' => ''),
        );
        $paginator = array(
                        'currentPage' => $this->getCurrentPage(),
                        'maxPerPage' => $this->getMaxPerPage(),
                        'totalPages' => $this->getNbPages(),
                        'totalResults' => $this->getNbResults(),
                    );
        
        $pageResult = $this->getCurrentPageResults();
        if(is_array($pageResult)){
            $results = $pageResult;
        }else{
            $results = $this->getCurrentPageResults()->getArrayCopy();
        }
        return array(
            'links' => $this->getLinks($route,$parameters),
            'meta' => $paginator,
            'data' => $results,
        );
    }
function formatToArrayStandard ( $ route = null , array $ parameters = array ( ) ) { $ links = array ( 'self' => array ( 'href' => '' ) , 'first' => array ( 'href' => '' ) , 'last' => array ( 'href' => '' ) , 'next' => array ( 'href' => '' ) , 'previous' => array ( 'href' => '' ) , ) ; $ paginator = array ( 'currentPage' => $ this -> getCurrentPage ( ) , 'maxPerPage' => $ this -> getMaxPerPage ( ) , 'totalPages' => $ this -> getNbPages ( ) , 'totalResults' => $ this -> getNbResults ( ) , ) ; $ pageResult = $ this -> getCurrentPageResults ( ) ; if ( is_array ( $ pageResult ) ) { $ results = $ pageResult ; } else { $ results = $ this -> getCurrentPageResults ( ) -> getArrayCopy ( ) ; } return array ( 'links' => $ this -> getLinks ( $ route , $ parameters ) , 'meta' => $ paginator , 'data' => $ results , ) ; }
Formato estandarizado y sencillo
@param type $route
@param array $parameters
@return type
Formato estandarizado y sencillo