original_string: public function setLinks()
      {
          // Only required for collections as items contain links by default
          if ($this->resource instanceof Collection && $paginator = $this->resource->getPaginator()) {
              $pagination = new Pagination($paginator);
              $this->links = $pagination->generateCollectionLinks();
          } else {
              unset($this->links);
          }
  
          return $this;
      }
code: public function setLinks()
      {
          // Only required for collections as items contain links by default
          if ($this->resource instanceof Collection && $paginator = $this->resource->getPaginator()) {
              $pagination = new Pagination($paginator);
              $this->links = $pagination->generateCollectionLinks();
          } else {
              unset($this->links);
          }
  
          return $this;
      }
code_tokens: public function setLinks ( ) { // Only required for collections as items contain links by default if ( $ this -> resource instanceof Collection && $ paginator = $ this -> resource -> getPaginator ( ) ) { $ pagination = new Pagination ( $ paginator ) ; $ this -> links = $ pagination -> generateCollectionLinks ( ) ; } else { unset ( $ this -> links ) ; } return $ this ; }
docstring: Set the response links data
  
  @return $this Instance of self
docstring_tokens: Set the response links data