Snuze  0.8.1
snuze\Request\Links\Links Class Reference
Inheritance diagram for snuze\Request\Links\Links:

Public Member Functions

 __construct (string $subredditName, string $sort)
 
 validate ()
 
- Public Member Functions inherited from snuze\Request\Request
 addHeader (string $name, string $value)
 
 getHeaders ()
 
 addParameter (string $name, $value=null)
 
 getParameter (string $name)
 
 getParameters ()
 
 getApiUri ()
 
 getEndpointPath ()
 
 getVerb ()
 
 getRequiresAuthentication ()
 
 getMandatoryParameters ()
 
 validate ()
 
- Public Member Functions inherited from snuze\SnuzeObject
 __construct (array $args=null)
 
 _getSnuzeId ()
 
 _getSnuzeClass ()
 
 _ident ()
 

Static Public Member Functions

static getValidSorts ()
 
- Static Public Member Functions inherited from snuze\Request\Request
static getValidParameters ()
 
static getValidVerbs ()
 

Public Attributes

const SORT_CONTRO = 'controversial'
 
const SORT_HOT = 'hot'
 
const SORT_NEW = 'new'
 
const SORT_RANDOM = 'random'
 
const SORT_RISING = 'rising'
 
const SORT_TOP = 'top'
 
const PARAM_AFTER = 'after'
 
const PARAM_BEFORE = 'before'
 
const PARAM_COUNT = 'count'
 
const PARAM_INCLUDE_CATEGORIES = 'include_categories'
 
const PARAM_LIMIT = 'limit'
 
const PARAM_SHOW = 'show'
 
const PARAM_SR_DETAIL = 'sr_detail'
 
- Public Attributes inherited from snuze\Request\Request
const API_URIS
 
const VERB_GET = 'GET'
 
const VERB_POST = 'POST'
 
const VERB_DELETE = 'DELETE'
 

Private Member Functions

 setSort (string $sort)
 

Private Attributes

 $_sort = null
 

Additional Inherited Members

- Protected Member Functions inherited from snuze\Request\Request
 setApiUri (string $apiUri)
 
 setEndpointPath (string $endpointPath)
 
 setVerb (string $verb)
 
 setRequiresAuthentication (bool $requiresAuthentication)
 
- Protected Member Functions inherited from snuze\SnuzeObject
 debug (string $message, bool $echo=false)
 
 info (string $message, bool $echo=false)
 
 warning (string $message, bool $echo=false)
 
 error (string $message, bool $echo=false)
 
- Protected Attributes inherited from snuze\Request\Request
 $parameters = []
 
 $mandatoryParameters = []
 
- Protected Attributes inherited from snuze\SnuzeObject
 $_snuzeId = null
 
 $_snuzeClass = null
 

Detailed Description

The Links class represents the common properties of all requests for links (AKA posts or submissions) from a subreddit. Parameters that can be used by all Links subtypes are defined here. Several subtypes of Links exist to define the properties specific to those request types.

You can't instantiate a generic Links request; instead, you should create and use the various subtypes: HotLinks, NewLinks, RisingLinks, etc.

Constructor & Destructor Documentation

◆ __construct()

snuze\Request\Links\Links::__construct ( string  $subredditName,
string  $sort 
)

Constructor. Calls parent, then sets properties specific to this Request.

References snuze\Request\Request\setEndpointPath(), and snuze\Request\Request\setVerb().

Member Function Documentation

◆ getValidSorts()

static snuze\Request\Links\Links::getValidSorts ( )
static

Get an array of supported sort orders.

Returns
array Links SORT_ constants and their values

◆ validate()

snuze\Request\Links\Links::validate ( )

Overrides and calls parent. Performs parameter validation specific to this type of Request.

Returns
bool Whether or not the Request is ready to send to the API
Exceptions

References snuze\Request\Request\getParameter().

Member Data Documentation

◆ PARAM_AFTER

const snuze\Request\Links\Links::PARAM_AFTER = 'after'

Defines the "after" parameter as valid. Used to control pagination. If set, this should be a link's fullname e.g. "t3_ce4vtr"

◆ PARAM_BEFORE

const snuze\Request\Links\Links::PARAM_BEFORE = 'before'

Defines the "before" parameter as valid. Used to control pagination. If set, this should be a link's fullname e.g. "t3_ce4vtr"

◆ PARAM_COUNT

const snuze\Request\Links\Links::PARAM_COUNT = 'count'

Defines the "count" parameter as valid. If set, this should be the number of links that have already been seen in this listing.

◆ PARAM_INCLUDE_CATEGORIES

const snuze\Request\Links\Links::PARAM_INCLUDE_CATEGORIES = 'include_categories'

Defines the "include_categories" parameter as valid

◆ PARAM_LIMIT

const snuze\Request\Links\Links::PARAM_LIMIT = 'limit'

Defines the "limit" parameter as valid

◆ PARAM_SHOW

const snuze\Request\Links\Links::PARAM_SHOW = 'show'

Defines the "show" parameter as valid. The only acceptable value for this parameter is 'all'. When set, any filters the authenticated user has set ("don't show me submissions..." preferences) will be disabled for this listing.

◆ PARAM_SR_DETAIL

const snuze\Request\Links\Links::PARAM_SR_DETAIL = 'sr_detail'

Defines the "sr_detail" parameter as valid

◆ SORT_CONTRO

const snuze\Request\Links\Links::SORT_CONTRO = 'controversial'

Defines the "controversial" sort order

◆ SORT_HOT

const snuze\Request\Links\Links::SORT_HOT = 'hot'

Defines the "hot" sort order

◆ SORT_NEW

const snuze\Request\Links\Links::SORT_NEW = 'new'

Defines the "new" sort order

◆ SORT_RANDOM

const snuze\Request\Links\Links::SORT_RANDOM = 'random'

Defines the "random" sort order

◆ SORT_RISING

const snuze\Request\Links\Links::SORT_RISING = 'rising'

Defines the "rising" sort order

◆ SORT_TOP

const snuze\Request\Links\Links::SORT_TOP = 'top'

Defines the "top" sort order


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