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

A request for questions. More...

Inheritance diagram for QuestionRequest:
PostRequest PagedRequest

Public Member Functions

 __construct ($url, $method=null)
 Constructor for a question request. More...
 
 Answers ()
 Retrieves the answers to the current set of questions. More...
 
 Linked ()
 Returns questions that are linked to the current set of questions. More...
 
 NoAnswers ()
 Restricts the questions returned to those that have no answers. More...
 
 Related ()
 Returns questions that are related to the current set of questions. More...
 
 Timeline ()
 Retrieves the revisions for the current set of questions. More...
 
 Unaccepted ()
 Restricts the questions returned to those that have no accepted answers. More...
 
 Unanswered ()
 Restricts the questions returned to those that are unanswered. More...
 
 Search ($search_text=null)
 Returns questions that match the specified search terms. More...
 
 Similar ($title=null)
 Returns questions that are similar to the current set of questions. More...
 
 SortByAdded ()
 Causes questions to be sorted according to when they were added to a user's favorites. More...
 
 SortByHot ()
 Causes questions to be sorted according to the 'hot' tab on the site. More...
 
 SortByMonth ()
 Causes hot questions for the current month to be returned. More...
 
 SortByWeek ()
 Causes hot questions for the current week to be returned. More...
 
 Tagged ($tags)
 Returns only questions with the specified tags. More...
 
 NotTagged ($tags)
 Returns only questions without the specified tags. More...
 
 InTitle ($title)
 Returns only questions that contain the specified text in the title. More...
 
 Title ($title)
 Returns questions that contain a similar title. More...
 
- Public Member Functions inherited from PostRequest
 __construct ($url, $return_object=null, $category=null, $method=null)
 Constructor for a post request. More...
 
 Comments ()
 Retrieves the comments associated with the posts. More...
 
 Revisions ()
 Retrieves the revisions for the specified posts. More...
 
 SuggestedEdits ()
 Retrieves the suggested edits pending for the specified posts. 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 questions.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor for a question request.

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

Member Function Documentation

◆ Answers()

QuestionRequest::Answers ( )

Retrieves the answers to the current set of questions.

Returns
a PostRequest object

◆ InTitle()

QuestionRequest::InTitle (   $title)

Returns only questions that contain the specified text in the title.

Parameters
$titlethe text to match in the title
Returns
the current instance

◆ Linked()

QuestionRequest::Linked ( )

Returns questions that are linked to the current set of questions.

Returns
the current instance

◆ NoAnswers()

QuestionRequest::NoAnswers ( )

Restricts the questions returned to those that have no answers.

Returns
the current instance

◆ NotTagged()

QuestionRequest::NotTagged (   $tags)

Returns only questions without the specified tags.

Parameters
$tagseither a single tag or an array of tags
Returns
the current instance

◆ Related()

QuestionRequest::Related ( )

Returns questions that are related to the current set of questions.

Returns
the current instance

◆ Search()

QuestionRequest::Search (   $search_text = null)

Returns questions that match the specified search terms.

Parameters
$search_texttext to search for in question titles
Returns
the current instance

◆ Similar()

QuestionRequest::Similar (   $title = null)

Returns questions that are similar to the current set of questions.

Parameters
$titlea title to test for
Returns
the current instance

◆ SortByAdded()

QuestionRequest::SortByAdded ( )

Causes questions to be sorted according to when they were added to a user's favorites.

Returns
the current instance

◆ SortByHot()

QuestionRequest::SortByHot ( )

Causes questions to be sorted according to the 'hot' tab on the site.

Returns
the current instance

◆ SortByMonth()

QuestionRequest::SortByMonth ( )

Causes hot questions for the current month to be returned.

Returns
the current instance

◆ SortByWeek()

QuestionRequest::SortByWeek ( )

Causes hot questions for the current week to be returned.

Returns
the current instance

◆ Tagged()

QuestionRequest::Tagged (   $tags)

Returns only questions with the specified tags.

Parameters
$tagseither a single tag or an array of tags
Returns
the current instance

◆ Timeline()

QuestionRequest::Timeline ( )

Retrieves the revisions for the current set of questions.

Returns
a TimelineRequest object

◆ Title()

QuestionRequest::Title (   $title)

Returns questions that contain a similar title.

Parameters
$titlethe title to match
Returns
the current instance

◆ Unaccepted()

QuestionRequest::Unaccepted ( )

Restricts the questions returned to those that have no accepted answers.

Returns
the current instance

◆ Unanswered()

QuestionRequest::Unanswered ( )

Restricts the questions returned to those that are unanswered.

Returns
the current instance

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