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

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_TIME = 't'
const TIME_VALUES = ['hour', 'day', 'week', 'month', 'year', 'all']
- Public Attributes inherited from snuze\Request\Request
const API_URIS
const VERB_GET = 'GET'
const VERB_POST = 'POST'

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

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

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

This file is part of Snuze, a PHP client for the Reddit API. Copyright 2019 Shaun Cummiskey Repository: Documentation:

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

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\TopLinks::validate ( )

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

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

References snuze\Request\Request\getParameter().

Member Data Documentation


const snuze\Request\Links\TopLinks::PARAM_TIME = 't'

Defines the "t" parameter as valid

A timeframe restriction. This is ONLY a valid parameter when the sort order is SORT_TOP or SORT_CONTROVERSIAL, and is required in those cases.


const snuze\Request\Links\TopLinks::TIME_VALUES = ['hour', 'day', 'week', 'month', 'year', 'all']

Define an array of acceptable values for PARAM_TIME.

See also

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