Stack.PHP
A simple and easy to use PHP library for the Stack Exchange API.
Public Member Functions | List of all members
BadgeRequest Class Reference

A request for badges. More...

Inheritance diagram for BadgeRequest:
PagedRequest

Public Member Functions

 __construct ($url, $method=null)
 Constructor for a badge request. More...
 
 Name ()
 Returns all name-based badges. More...
 
 Recipients ()
 Returns recently awarded badges. More...
 
 Tags ()
 Returns all tag-based badges. More...
 
 SortByAwarded ()
 Causes badges to be sorted according to the date they were awarded. More...
 
 SortByRank ()
 Causes badges to be sorted according to their rank. More...
 
 SortByType ()
 Causes badges to be sorted according to their type. More...
 
- Public Member Functions inherited from PagedRequest
 __construct ($url, $return_object, $category=null, $method=null)
 Constructor for a paged request. More...
 
 Exec ()
 Performs the HTTP request. More...
 
 ID ($id)
 Adds the provided ID(s) to the request. More...
 
 Tag ($tag)
 Adds the provided tags to the request. More...
 
 FromDate ($date)
 Ensures that only items created after the specified date are returned in the response. More...
 
 ToDate ($date)
 Ensures that only items created before the specified date are returned in the response. More...
 
 Min ($minimum)
 Sets the minimum value for the range of the current sort. More...
 
 Max ($maximum)
 Sets the maximum value for the range of the current sort. More...
 
 Filter ($filter, $pagination_filter=null)
 Sets the specified filter for the request. More...
 
 URL ()
 Returns the URL constructed from this request. More...
 
 Ascending ()
 Causes the items to be returned in ascending order. More...
 
 Descending ()
 Causes the items to be returned in descending order. More...
 
 InName ($name)
 Returns only the items that contain the specified text in their names. More...
 
 SortBy ($method)
 Sort the results by the provided sort method. More...
 
 SortByActivity ()
 Orders the returned items by activity. More...
 
 SortByCreation ()
 Orders the returned items by creation date. More...
 
 SortByName ()
 Orders the returned items by their name. More...
 
 SortByVotes ()
 Orders the returned items by their score. More...
 

Additional Inherited Members

- Protected Attributes inherited from PagedRequest
 $url
 The URL that will be modified as methods are called.
 

Detailed Description

A request for badges.

Constructor & Destructor Documentation

◆ __construct()

BadgeRequest::__construct (   $url,
  $method = null 
)

Constructor for a badge request.

Parameters
$urlthe domain name of the site or a URL object
$methodthe method being called

Member Function Documentation

◆ Name()

BadgeRequest::Name ( )

Returns all name-based badges.

Returns
the current instance

◆ Recipients()

BadgeRequest::Recipients ( )

Returns recently awarded badges.

Returns
the current instance

◆ SortByAwarded()

BadgeRequest::SortByAwarded ( )

Causes badges to be sorted according to the date they were awarded.

Returns
the current instance

◆ SortByRank()

BadgeRequest::SortByRank ( )

Causes badges to be sorted according to their rank.

Returns
the current instance

◆ SortByType()

BadgeRequest::SortByType ( )

Causes badges to be sorted according to their type.

Returns
the current instance

◆ Tags()

BadgeRequest::Tags ( )

Returns all tag-based badges.

Returns
the current instance

The documentation for this class was generated from the following file: