src/Endpoint/Abstracts/AbstractCollectionEndpoint.php
protected function buildModel(array $data = array()){
        $Model = NULL;
        if (isset($this->model)){
            $Model = new $this->model();
            $Model->setBaseUrl($this->getBaseUrl());
            if ($this->getAuth() !== NULL) {
                $Model->setAuth($this->getAuth());
            }
            if (!empty($data)){
                foreach($data as $key => $value){
                    $Model->set($key,$value);
                }
            }
        }
        return $Model;
    }
protected function buildModel(array $data = array()){
        $Model = NULL;
        if (isset($this->model)){
            $Model = new $this->model();
            $Model->setBaseUrl($this->getBaseUrl());
            if ($this->getAuth() !== NULL) {
                $Model->setAuth($this->getAuth());
            }
            if (!empty($data)){
                foreach($data as $key => $value){
                    $Model->set($key,$value);
                }
            }
        }
        return $Model;
    }
protected function buildModel ( array $ data = array ( ) ) { $ Model = NULL ; if ( isset ( $ this -> model ) ) { $ Model = new $ this -> model ( ) ; $ Model -> setBaseUrl ( $ this -> getBaseUrl ( ) ) ; if ( $ this -> getAuth ( ) !== NULL ) { $ Model -> setAuth ( $ this -> getAuth ( ) ) ; } if ( ! empty ( $ data ) ) { foreach ( $ data as $ key => $ value ) { $ Model -> set ( $ key , $ value ) ; } } } return $ Model ; }
Build the ModelEndpoint
@param array $data
@return AbstractModelEndpoint
Build the ModelEndpoint