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

Public Member Functions

 __construct (string $subredditName)
 
 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 ()
 

Public Attributes

const PARAM_GEO = 'g'
 
const GEO_VALUES
 
- Public Attributes inherited from snuze\Request\Request
const API_URIS
 
const VERB_GET = 'GET'
 
const VERB_POST = 'POST'
 
const VERB_DELETE = 'DELETE'
 

Additional Inherited Members

- Static Public Member Functions inherited from snuze\Request\Request
static getValidParameters ()
 
static getValidVerbs ()
 
- 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

HotLinks defines the structure and parameters of a request to the /r/[subreddit]/hot API endpoint.

This endpoint returns links from the specified subreddit, presented in the "hot" sort order.


This file is part of Snuze, a PHP client for the Reddit API. Copyright 2019 Shaun Cummiskey shaun.nosp@m.@sha.nosp@m.unc.c.nosp@m.om https://shaunc.com/ Repository: https://github.com/snuze/snuze/ Documentation: https://snuze.shaunc.com/

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Member Function Documentation

◆ validate()

snuze\Request\Links\HotLinks::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

◆ GEO_VALUES

const snuze\Request\Links\HotLinks::GEO_VALUES
Initial value:
= [
'GLOBAL', 'AR', 'AU', 'BG', 'CA', 'CL', 'CO', 'CZ', 'FI', 'GB', 'GR',
'HR', 'HU', 'IE', 'IN', 'IS', 'JP', 'MX', 'MY', 'NZ', 'PH', 'PL',
'PR', 'PT', 'RO', 'RS', 'SE', 'SG', 'TH', 'TR', 'TW', 'US', 'US_AK',
'US_AL', 'US_AR', 'US_AZ', 'US_CA', 'US_CO', 'US_CT', 'US_DC', 'US_DE',
'US_FL', 'US_GA', 'US_HI', 'US_IA', 'US_ID', 'US_IL', 'US_IN', 'US_KS',
'US_KY', 'US_LA', 'US_MA', 'US_MD', 'US_ME', 'US_MI', 'US_MN', 'US_MO',
'US_MS', 'US_MT', 'US_NC', 'US_ND', 'US_NE', 'US_NH', 'US_NJ', 'US_NM',
'US_NV', 'US_NY', 'US_OH', 'US_OK', 'US_OR', 'US_PA', 'US_RI', 'US_SC',
'US_SD', 'US_TN', 'US_TX', 'US_UT', 'US_VA', 'US_VT', 'US_WA', 'US_WI',
'US_WV', 'US_WY'
]

Define an array of acceptable values for PARAM_GEO.

See also
https://www.reddit.com/dev/api/#GET_hot

◆ PARAM_GEO

const snuze\Request\Links\HotLinks::PARAM_GEO = 'g'

Defines the "g" parameter as valid

A geographic region code, as specified by Reddit, that can be used as a hint when requesting the "hot" listing for a subreddit. This is ONLY a valid parameter when the sort order is SORT_HOT, but is never required. The value is restricted to a predefined list of options set by Reddit (see ::validate(), below).


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