src/Endpoint/Abstracts/AbstractCollectionEndpoint.php
protected function updateCollection(){
        $responseBody = $this->Response->getBody();
        if (is_array($responseBody)){
            if (isset($this->model)){
                $modelIdKey = $this->buildModel()->modelIdKey();
                foreach($responseBody as $key => $model){
                    if (isset($model[$modelIdKey])){
                        $this->collection[$model[$modelIdKey]] = $model;
                    } else {
                        $this->collection[] = $model;
                    }
                }
            } else {
                $this->collection = $responseBody;
            }
        }
    }
protected function updateCollection(){
        $responseBody = $this->Response->getBody();
        if (is_array($responseBody)){
            if (isset($this->model)){
                $modelIdKey = $this->buildModel()->modelIdKey();
                foreach($responseBody as $key => $model){
                    if (isset($model[$modelIdKey])){
                        $this->collection[$model[$modelIdKey]] = $model;
                    } else {
                        $this->collection[] = $model;
                    }
                }
            } else {
                $this->collection = $responseBody;
            }
        }
    }
protected function updateCollection ( ) { $ responseBody = $ this -> Response -> getBody ( ) ; if ( is_array ( $ responseBody ) ) { if ( isset ( $ this -> model ) ) { $ modelIdKey = $ this -> buildModel ( ) -> modelIdKey ( ) ; foreach ( $ responseBody as $ key => $ model ) { if ( isset ( $ model [ $ modelIdKey ] ) ) { $ this -> collection [ $ model [ $ modelIdKey ] ] = $ model ; } else { $ this -> collection [ ] = $ model ; } } } else { $ this -> collection = $ responseBody ; } } }
Configures the collection based on the Response Body
Configures the collection based on the Response Body