public function updateById($id, array $newAttributes)
    {
        $model = $this->getById($id);
        $results = $model->update($newAttributes);

        if(!$results){
            throw new UpdateFailedRepositoryException();
        }

        return $model;
    }
public function updateById($id, array $newAttributes)
    {
        $model = $this->getById($id);
        $results = $model->update($newAttributes);

        if(!$results){
            throw new UpdateFailedRepositoryException();
        }

        return $model;
    }
public function updateById ( $ id , array $ newAttributes ) { $ model = $ this -> getById ( $ id ) ; $ results = $ model -> update ( $ newAttributes ) ; if ( ! $ results ) { throw new UpdateFailedRepositoryException ( ) ; } return $ model ; }
Update a model given it's id and an array of attributes

@param $id
@param array $newAttributes
@return mixed
@throws UpdateFailedRepositoryException
Update a model given it s id and an array of attributes