Snuze  0.8.1
snuze\Reddit\Thing\Subreddit Class Reference
Inheritance diagram for snuze\Reddit\Thing\Subreddit:

Public Member Functions

 __construct ()
 
 getAccountsActive ()
 
 getAccountsActiveIsFuzzed ()
 
 getActiveUserCount ()
 
 getAdvertiserCategory ()
 
 getAllOriginalContent ()
 
 getAllowDiscovery ()
 
 getAllowImages ()
 
 getAllowVideogifs ()
 
 getAllowVideos ()
 
 getBannerBackgroundColor ()
 
 getBannerBackgroundImage ()
 
 getBannerImg ()
 
 getBannerSize ()
 
 getCanAssignLinkFlair ()
 
 getCanAssignUserFlair ()
 
 getCoins ()
 
 setCoins (int $coins)
 
 getCollapseDeletedComments ()
 
 getCollectionsEnabled ()
 
 setCollectionsEnabled (bool $collectionsEnabled)
 
 getCommentScoreHideMins ()
 
 getCommunityIcon ()
 
 getContentCategory ()
 
 getDescription ()
 
 getDescriptionHtml ()
 
 getDisableContributorRequests ()
 
 getDisplayName ()
 
 getDisplayNamePrefixed ()
 
 getEmojisCustomSize ()
 
 getEmojisEnabled ()
 
 getEventPostsEnabled ()
 
 setEventPostsEnabled (bool $eventPostsEnabled)
 
 getFreeFormReports ()
 
 getHasMenuWidget ()
 
 getHeaderImg ()
 
 getHeaderSize ()
 
 getHeaderTitle ()
 
 getHideAds ()
 
 getIconImg ()
 
 getIconSize ()
 
 getIsCrosspostableSubreddit ()
 
 setIsCrosspostableSubreddit (bool $isCrosspostableSubreddit=null)
 
 getIsEnrolledInNewModmail ()
 
 getKeyColor ()
 
 getLang ()
 
 getLinkFlairEnabled ()
 
 getLinkFlairPosition ()
 
 getMobileBannerImage ()
 
 getName ()
 
 getNotificationLevel ()
 
 getOriginalContentTagEnabled ()
 
 getOver18 ()
 
 getPrimaryColor ()
 
 getPublicDescription ()
 
 getPublicDescriptionHtml ()
 
 getPublicTraffic ()
 
 getQuarantine ()
 
 getRestrictCommenting ()
 
 getRestrictPosting ()
 
 getShowMedia ()
 
 getShowMediaPreview ()
 
 getSpoilersEnabled ()
 
 getSubmissionType ()
 
 getSubmitLinkLabel ()
 
 getSubmitText ()
 
 getSubmitTextHtml ()
 
 getSubmitTextLabel ()
 
 getSubredditType ()
 
 getSubscribers ()
 
 getSuggestedCommentSort ()
 
 getTitle ()
 
 getUrl ()
 
 getUserCanFlairInSr ()
 
 getUserFlairBackgroundColor ()
 
 getUserFlairCssClass ()
 
 getUserFlairEnabledInSr ()
 
 getUserFlairPosition ()
 
 getUserFlairRichtext ()
 
 getUserFlairTemplateId ()
 
 getUserFlairText ()
 
 getUserFlairTextColor ()
 
 getUserFlairType ()
 
 getUserHasFavorited ()
 
 getUserIsBanned ()
 
 getUserIsContributor ()
 
 getUserIsModerator ()
 
 getUserIsMuted ()
 
 getUserIsSubscriber ()
 
 getUserSrFlairEnabled ()
 
 getUserSrThemeEnabled ()
 
 getVideostreamLinksCount ()
 
 getWhitelistStatus ()
 
 getWikiEnabled ()
 
 getWls ()
 
- Public Member Functions inherited from snuze\Reddit\Thing\Thing
 __construct (string $kind)
 
 _getSourceJson ()
 
 getId ()
 
 getKind ()
 
 getCreated ()
 
 getCreatedUtc ()
 
 getFullname ()
 
 toJson ()
 
 fromJson (string $json)
 
- Public Member Functions inherited from snuze\SnuzeObject
 __construct (array $args=null)
 
 _getSnuzeId ()
 
 _getSnuzeClass ()
 
 _ident ()
 

Public Attributes

const REGEX_VALID_NAME = '/^((?:[a-z0-9](?:[a-z0-9_]){2,20})|reddit\.com|ca|de|es|eu|fr|it|ja|nl|pl|ru)$/i'
 
- Public Attributes inherited from snuze\Reddit\Thing\Thing
const KIND_COMMENT = 't1'
 
const KIND_ACCOUNT = 't2'
 
const KIND_LINK = 't3'
 
const KIND_MESSAGE = 't4'
 
const KIND_SUBREDDIT = 't5'
 
const KIND_AWARD = 't6'
 
const REGEX_VALID_ID = '|^[a-z0-9]{1,13}$|i'
 

Protected Member Functions

 setAccountsActive ($accountsActive=null)
 
 setAccountsActiveIsFuzzed (bool $accountsActiveIsFuzzed)
 
 setActiveUserCount ($activeUserCount)
 
 setAdvertiserCategory (string $advertiserCategory)
 
 setAllOriginalContent (bool $allOriginalContent)
 
 setAllowDiscovery (bool $allowDiscovery)
 
 setAllowImages (bool $allowImages)
 
 setAllowVideogifs (bool $allowVideogifs)
 
 setAllowVideos (bool $allowVideos)
 
 setBannerBackgroundColor (string $bannerBackgroundColor)
 
 setBannerBackgroundImage (string $bannerBackgroundImage)
 
 setBannerImg (string $bannerImg)
 
 setBannerSize (array $bannerSize=null)
 
 setCanAssignLinkFlair (bool $canAssignLinkFlair)
 
 setCanAssignUserFlair (bool $canAssignUserFlair)
 
 setCollapseDeletedComments (bool $collapseDeletedComments)
 
 setCommentScoreHideMins (int $commentScoreHideMins=0)
 
 setCommunityIcon (string $communityIcon)
 
 setContentCategory (string $contentCategory)
 
 setDescription (string $description)
 
 setDescriptionHtml (string $descriptionHtml=null)
 
 setDisableContributorRequests (bool $disableContributorRequests)
 
 setDisplayName (string $displayName)
 
 setDisplayNamePrefixed (string $displayNamePrefixed)
 
 setEmojisCustomSize (array $emojisCustomSize=null)
 
 setEmojisEnabled (bool $emojisEnabled)
 
 setFreeFormReports (bool $freeFormReports)
 
 setHasMenuWidget (bool $hasMenuWidget)
 
 setHeaderImg (string $headerImg=null)
 
 setHeaderSize (array $headerSize=null)
 
 setHeaderTitle (string $headerTitle=null)
 
 setHideAds (bool $hideAds)
 
 setIconImg (string $iconImg)
 
 setIconSize (array $iconSize=null)
 
 setIsEnrolledInNewModmail (bool $isEnrolledInNewModmail=null)
 
 setKeyColor (string $keyColor)
 
 setLang (string $lang)
 
 setLinkFlairEnabled (bool $linkFlairEnabled)
 
 setLinkFlairPosition (string $linkFlairPosition)
 
 setMobileBannerImage (string $mobileBannerImage)
 
 setName (string $name)
 
 setNotificationLevel (string $notificationLevel=null)
 
 setOriginalContentTagEnabled (bool $originalContentTagEnabled)
 
 setOver18 (bool $over18)
 
 setPrimaryColor (string $primaryColor)
 
 setPublicDescription (string $publicDescription)
 
 setPublicDescriptionHtml (string $publicDescriptionHtml)
 
 setPublicTraffic (bool $publicTraffic)
 
 setQuarantine (bool $quarantine)
 
 setRestrictCommenting (bool $restrictCommenting)
 
 setRestrictPosting (bool $restrictPosting)
 
 setShowMedia (bool $showMedia)
 
 setShowMediaPreview (bool $showMediaPreview)
 
 setSpoilersEnabled (bool $spoilersEnabled)
 
 setSubmissionType (string $submissionType)
 
 setSubmitLinkLabel (string $submitLinkLabel=null)
 
 setSubmitText (string $submitText)
 
 setSubmitTextHtml (string $submitTextHtml=null)
 
 setSubmitTextLabel (string $submitTextLabel=null)
 
 setSubredditType (string $subredditType)
 
 setSubscribers (int $subscribers)
 
 setSuggestedCommentSort (string $suggestedCommentSort=null)
 
 setTitle (string $title)
 
 setUrl (string $url)
 
 setUserCanFlairInSr (bool $userCanFlairInSr=null)
 
 setUserFlairBackgroundColor (string $userFlairBackgroundColor=null)
 
 setUserFlairCssClass (string $userFlairCssClass=null)
 
 setUserFlairEnabledInSr (bool $userFlairEnabledInSr=null)
 
 setUserFlairPosition (string $userFlairPosition)
 
 setUserFlairRichtext (array $userFlairRichtext)
 
 setUserFlairTemplateId (string $userFlairTemplateId=null)
 
 setUserFlairText (string $userFlairText=null)
 
 setUserFlairTextColor (string $userFlairTextColor=null)
 
 setUserFlairType (string $userFlairType)
 
 setUserHasFavorited (bool $userHasFavorited)
 
 setUserIsBanned (bool $userIsBanned)
 
 setUserIsContributor (bool $userIsContributor)
 
 setUserIsModerator (bool $userIsModerator)
 
 setUserIsMuted (bool $userIsMuted)
 
 setUserIsSubscriber (bool $userIsSubscriber)
 
 setUserSrFlairEnabled (bool $userSrFlairEnabled=null)
 
 setUserSrThemeEnabled (bool $userSrThemeEnabled)
 
 setVideostreamLinksCount (int $videostreamLinksCount=null)
 
 setWhitelistStatus (string $whitelistStatus=null)
 
 setWikiEnabled (bool $wikiEnabled=null)
 
 setWls (int $wls=null)
 
- Protected Member Functions inherited from snuze\Reddit\Thing\Thing
 setId (string $id)
 
 setKind (string $kind)
 
 setCreated (float $created)
 
 setCreatedUtc (float $createdUtc)
 
 getPropertyTranslationMap ()
 
- 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

 $accountsActive = 0
 
 $accountsActiveIsFuzzed = false
 
 $activeUserCount = 0
 
 $advertiserCategory = ''
 
 $allOriginalContent = false
 
 $allowDiscovery = true
 
 $allowImages = true
 
 $allowVideogifs = true
 
 $allowVideos = true
 
 $bannerBackgroundColor = ''
 
 $bannerBackgroundImage = ''
 
 $bannerImg = ''
 
 $bannerSize = null
 
 $canAssignLinkFlair = false
 
 $canAssignUserFlair = false
 
 $coins = 0
 
 $collapseDeletedComments = false
 
 $collectionsEnabled = false
 
 $commentScoreHideMins = 0
 
 $communityIcon = ''
 
 $contentCategory = ''
 
 $description = ''
 
 $descriptionHtml = null
 
 $disableContributorRequests = false
 
 $displayName = null
 
 $displayNamePrefixed = ''
 
 $emojisCustomSize = null
 
 $emojisEnabled = false
 
 $eventPostsEnabled = false
 
 $freeFormReports = true
 
 $hasMenuWidget = false
 
 $headerImg = null
 
 $headerSize = null
 
 $headerTitle = null
 
 $hideAds = false
 
 $iconImg = ''
 
 $iconSize = null
 
 $isCrosspostableSubreddit = null
 
 $isEnrolledInNewModmail = null
 
 $keyColor = ''
 
 $lang = ''
 
 $linkFlairEnabled = false
 
 $linkFlairPosition = ''
 
 $mobileBannerImage = ''
 
 $name = ''
 
 $notificationLevel = null
 
 $originalContentTagEnabled = false
 
 $over18 = false
 
 $primaryColor = ''
 
 $publicDescription = ''
 
 $publicDescriptionHtml = ''
 
 $publicTraffic = false
 
 $quarantine = false
 
 $restrictCommenting = false
 
 $restrictPosting = true
 
 $showMedia = false
 
 $showMediaPreview = true
 
 $spoilersEnabled = true
 
 $submissionType = ''
 
 $submitLinkLabel = null
 
 $submitText = ''
 
 $submitTextHtml = null
 
 $submitTextLabel = null
 
 $subredditType = ''
 
 $subscribers = 0
 
 $suggestedCommentSort = null
 
 $title = null
 
 $url = ''
 
 $userCanFlairInSr = null
 
 $userFlairBackgroundColor = null
 
 $userFlairCssClass = null
 
 $userFlairEnabledInSr = true
 
 $userFlairPosition = ''
 
 $userFlairRichtext = []
 
 $userFlairTemplateId = null
 
 $userFlairText = null
 
 $userFlairTextColor = null
 
 $userFlairType = ''
 
 $userHasFavorited = false
 
 $userIsBanned = false
 
 $userIsContributor = false
 
 $userIsModerator = false
 
 $userIsMuted = false
 
 $userIsSubscriber = false
 
 $userSrFlairEnabled = null
 
 $userSrThemeEnabled = false
 
 $videostreamLinksCount = null
 
 $whitelistStatus = null
 
 $wikiEnabled = null
 
 $wls = null
 
- Protected Attributes inherited from snuze\Reddit\Thing\Thing
 $_kind = null
 
 $_propertyNames = []
 
 $_propertyTranslationRegex = '|([a-z])([A-Z0-9])|'
 
 $_sourceJson = ''
 
 $id = null
 
 $created = 0.0
 
 $createdUtc = 0.0
 
- Protected Attributes inherited from snuze\SnuzeObject
 $_snuzeId = null
 
 $_snuzeClass = null
 

Additional Inherited Members

- Static Public Member Functions inherited from snuze\Reddit\Thing\Thing
static getValidKinds ()
 

Detailed Description

The Subreddit class represents the significant properties of a subreddit. An attempt has been made to map all fields supplied by the API, regardless of their utility (or lack thereof).

Implementation warning: Array properties are currently populated as-is, without any further processing. Calling their getters will return an array. In the case of image dimensions ($bannerSize, $emojisCustomSize, etc.) the array will contain integer width and height values. In other cases, it may hold key/value pairs defining the property. This is subject to change in a future major version, such that some other value(s) may be returned instead.


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.

Constructor & Destructor Documentation

◆ __construct()

snuze\Reddit\Thing\Subreddit::__construct ( )

Constructor.

References snuze\Reddit\Thing\Thing\KIND_SUBREDDIT.

Member Function Documentation

◆ getAccountsActive()

snuze\Reddit\Thing\Subreddit::getAccountsActive ( )

Get the (approximate) number of users interacting with this subreddit over the past 15 minutes. Duplicate of getActiveUserCount().

For some unknown reason, Reddit occasionally returns this as an empty array instead of an integer. It's not reproducible; you can ask for the same subreddit 500 times, and get an integer 499 times, and an empty array once. In cases where this occurs, this method will return 0.

Returns
int

◆ getAccountsActiveIsFuzzed()

snuze\Reddit\Thing\Subreddit::getAccountsActiveIsFuzzed ( )

Get whether or not accountsActive and activeUserCount values are slightly adjusted to mitigate statistical inference attacks

Returns
bool

◆ getActiveUserCount()

snuze\Reddit\Thing\Subreddit::getActiveUserCount ( )

Get the (approximate) number of users interacting with this subreddit. Duplicate of getAccountsActive().

For some unknown reason, Reddit occasionally returns this as an empty array instead of an integer. It's not reproducible; you can ask for the same subreddit 500 times, and get an integer 499 times, and an empty array once. In cases where this occurs, this method will return 0.

Returns
int

◆ getAdvertiserCategory()

snuze\Reddit\Thing\Subreddit::getAdvertiserCategory ( )

Get the advertiser category, if any, this subreddit belongs to.

Returns
string

◆ getAllOriginalContent()

snuze\Reddit\Thing\Subreddit::getAllOriginalContent ( )

Get whether or not this subreddit has the "mark all posts in this subreddit as Original Content (OC) on the desktop redesign" option enabled

Returns
bool

◆ getAllowDiscovery()

snuze\Reddit\Thing\Subreddit::getAllowDiscovery ( )

Get whether or not this subreddit has the "allow this subreddit to be exposed to users who have shown intent or interest through discovery and onboarding" option enabled

Returns
bool

◆ getAllowImages()

snuze\Reddit\Thing\Subreddit::getAllowImages ( )

Get whether or not this subreddit has the "allow image uploads and links to image hosting sites" option enabled

Returns
bool

◆ getAllowVideogifs()

snuze\Reddit\Thing\Subreddit::getAllowVideogifs ( )

Get whether or not videogifs are allowed in this subreddit, whatever videogifs are.

Returns
bool
Todo:
verify what exactly this corresponds to

◆ getAllowVideos()

snuze\Reddit\Thing\Subreddit::getAllowVideos ( )

Get whether or not this subreddit has the "allow video uploads" option enabled

Returns
bool

◆ getBannerBackgroundColor()

snuze\Reddit\Thing\Subreddit::getBannerBackgroundColor ( )

Get the HTML hex color code for this subreddit's banner background, if any

Returns
string

◆ getBannerBackgroundImage()

snuze\Reddit\Thing\Subreddit::getBannerBackgroundImage ( )

Get the URL to this subreddit's banner background image, if any. This is the image that displays on the desktop site.

Returns
string

◆ getBannerImg()

snuze\Reddit\Thing\Subreddit::getBannerImg ( )

Get the URL to this subreddit's banner image, if any.

Returns
string

◆ getBannerSize()

snuze\Reddit\Thing\Subreddit::getBannerSize ( )

Get the banner image dimensions. If set, this will be an array containing two integer values.

Returns
array|null

◆ getCanAssignLinkFlair()

snuze\Reddit\Thing\Subreddit::getCanAssignLinkFlair ( )

Get whether or not users can assign flair to their own links in this subreddit

Returns
bool

◆ getCanAssignUserFlair()

snuze\Reddit\Thing\Subreddit::getCanAssignUserFlair ( )

Get whether or not this subreddit allows users to assign flair to themselves

Returns
bool

◆ getCoins()

snuze\Reddit\Thing\Subreddit::getCoins ( )

Get this subreddit's Community Awards coin balance. If the subreddit has no Community Awards coins, this will be 0.

Returns
int

◆ getCollapseDeletedComments()

snuze\Reddit\Thing\Subreddit::getCollapseDeletedComments ( )

Get whether or not this subreddit has the "collapse deleted and removed comments" option enabled

Returns
bool

◆ getCollectionsEnabled()

snuze\Reddit\Thing\Subreddit::getCollectionsEnabled ( )

Get whether or not this subreddit supports links that are collections of other links

Returns
bool|null

◆ getCommentScoreHideMins()

snuze\Reddit\Thing\Subreddit::getCommentScoreHideMins ( )

Get the "Minutes to hide comment scores" value for this subreddit

Returns
int

◆ getCommunityIcon()

snuze\Reddit\Thing\Subreddit::getCommunityIcon ( )

Get the URL to this subreddit's community icon image, if any

Returns
string

◆ getContentCategory()

snuze\Reddit\Thing\Subreddit::getContentCategory ( )

Get this subreddit's assigned content category, if any

Returns
string

◆ getDescription()

snuze\Reddit\Thing\Subreddit::getDescription ( )

Get this subreddit's description

Returns
string

◆ getDescriptionHtml()

snuze\Reddit\Thing\Subreddit::getDescriptionHtml ( )

Get this subreddit's description as HTML instead of text

Returns
string|null

◆ getDisableContributorRequests()

snuze\Reddit\Thing\Subreddit::getDisableContributorRequests ( )

Get whether or not this subreddit forbids public requests for status as an approved submitter. (This may be true even if the subreddit is currently public.)

Returns
bool

◆ getDisplayName()

snuze\Reddit\Thing\Subreddit::getDisplayName ( )

Get the undecorated display name of the subreddit e.g. "funny"

Returns
string

◆ getDisplayNamePrefixed()

snuze\Reddit\Thing\Subreddit::getDisplayNamePrefixed ( )

Get the subreddit name with its relative path e.g. "r/funny", or "u/joe" for user profile subreddits

Returns
string

◆ getEmojisCustomSize()

snuze\Reddit\Thing\Subreddit::getEmojisCustomSize ( )

Get the emoji image dimensions. If set, this will be an array containing two integer values.

Returns
array|null

◆ getEmojisEnabled()

snuze\Reddit\Thing\Subreddit::getEmojisEnabled ( )

Get whether or not custom emojis are enabled for this subreddit

Returns
bool

◆ getEventPostsEnabled()

snuze\Reddit\Thing\Subreddit::getEventPostsEnabled ( )

Get whether or not this subreddit supports links that are event posts

Returns
bool

◆ getFreeFormReports()

snuze\Reddit\Thing\Subreddit::getFreeFormReports ( )

Get whether or not this subreddit has the "allow free-form reports by users" option enabled

Returns
bool

◆ getHasMenuWidget()

snuze\Reddit\Thing\Subreddit::getHasMenuWidget ( )

Get whether or not this subreddit has custom menu tabs defined by a moderator.

Returns
bool

◆ getHeaderImg()

snuze\Reddit\Thing\Subreddit::getHeaderImg ( )

Get the URL to this subreddit's header image, if any. This is the image that appears in place of Snoo on the old style Reddit.

Returns
string|null

◆ getHeaderSize()

snuze\Reddit\Thing\Subreddit::getHeaderSize ( )

Get the header image dimensions. If set, this will be an array containing two integer values.

Returns
array|null

◆ getHeaderTitle()

snuze\Reddit\Thing\Subreddit::getHeaderTitle ( )

Get the title/alt text of this subreddit's header image, if any

Returns
string|null

◆ getHideAds()

snuze\Reddit\Thing\Subreddit::getHideAds ( )

Get whether or not ads have been administratively suppressed in this subreddit

Returns
bool

◆ getIconImg()

snuze\Reddit\Thing\Subreddit::getIconImg ( )

Get the URL to this subreddit's icon image, if any. This icon is displayed in the "Community Details" portion of the sidebar and in public "card" style listings, both on the redesign interface.

Returns
string

◆ getIconSize()

snuze\Reddit\Thing\Subreddit::getIconSize ( )

Get the icon image dimensions. If set, this will be an array containing two integer values.

Returns
array|null

◆ getIsCrosspostableSubreddit()

snuze\Reddit\Thing\Subreddit::getIsCrosspostableSubreddit ( )

Get whether or not this subreddit has the "Allow crossposting of posts" preference enabled. If crossposting is disabled, the Reddit API returns null instead of false; this method mirrors that behavior.

Returns
bool|null

◆ getIsEnrolledInNewModmail()

snuze\Reddit\Thing\Subreddit::getIsEnrolledInNewModmail ( )

Get whether or not this subreddit uses the new modmail system.

This is a moderator-only property. To receive an accurate value, the currently authenticated user must be a moderator of the subreddit where this link is posted.

Returns
bool|null

◆ getKeyColor()

snuze\Reddit\Thing\Subreddit::getKeyColor ( )

Get the HTML hex color code for this subreddit's general theme color, if any is set. Corresponds to the "used as a thematic color for your subreddit on mobile" option.

Returns
string

◆ getLang()

snuze\Reddit\Thing\Subreddit::getLang ( )

Get the language code for this subreddit, if any; e.g. "en" or "pt-pt"

Returns
string

◆ getLinkFlairEnabled()

snuze\Reddit\Thing\Subreddit::getLinkFlairEnabled ( )

Get whether or not link flair is supported in this subreddit

Returns
bool

◆ getLinkFlairPosition()

snuze\Reddit\Thing\Subreddit::getLinkFlairPosition ( )

Get the CSS position of a link's flair in this subreddit, if any, relative to the link, e.g. "left", "right"

Returns
string

◆ getMobileBannerImage()

snuze\Reddit\Thing\Subreddit::getMobileBannerImage ( )

Get the URL to this subreddit's mobile banner image, if any

Returns
string

◆ getName()

snuze\Reddit\Thing\Subreddit::getName ( )

Returns the Reddit fullname identifier of this subreddit e.g. "t5_2qh33". If you want the subreddit display name e.g. "funny", use getDisplayName() instead.

Returns
string

◆ getNotificationLevel()

snuze\Reddit\Thing\Subreddit::getNotificationLevel ( )

Get the notification level (?)

This is a moderator-only property. To receive an accurate value, the currently authenticated user must be a moderator of the subreddit where this link is posted.

Returns
string|null
Todo:
verify what exactly this corresponds to

◆ getOriginalContentTagEnabled()

snuze\Reddit\Thing\Subreddit::getOriginalContentTagEnabled ( )

Get whether or not this subreddit has the "enable marking posts as Original Content (OC) on the desktop redesign" option enabled

Returns
bool

◆ getOver18()

snuze\Reddit\Thing\Subreddit::getOver18 ( )

Get whether or not this subreddit has the "viewers must be over eighteen years old" option enabled

Returns
bool

◆ getPrimaryColor()

snuze\Reddit\Thing\Subreddit::getPrimaryColor ( )

Get the HTML hex color code for this subreddit's primary color, if any. This corresponds to the "Base" theme color in the redesign subreddit manager interface.

Returns
string

◆ getPublicDescription()

snuze\Reddit\Thing\Subreddit::getPublicDescription ( )

Get the external description for this subreddit, if any. This is used in <meta name="description"> tags, and in subreddit search results; it's distinct from the sidebar description, which can be found using getDescription()

Returns
string
See also
getDescription()

◆ getPublicDescriptionHtml()

snuze\Reddit\Thing\Subreddit::getPublicDescriptionHtml ( )

Get the external description for this subreddit, if any, as HTML instead of text

Returns
string

◆ getPublicTraffic()

snuze\Reddit\Thing\Subreddit::getPublicTraffic ( )

Get whether or not this subreddit exposes its traffic stats to the public

Returns
bool

◆ getQuarantine()

snuze\Reddit\Thing\Subreddit::getQuarantine ( )

Get whether or not this subreddit is quarantined

Returns
bool

◆ getRestrictCommenting()

snuze\Reddit\Thing\Subreddit::getRestrictCommenting ( )

Get whether or not commenting is restricted (?)

Returns
bool
Todo:
verify what exactly this corresponds to

◆ getRestrictPosting()

snuze\Reddit\Thing\Subreddit::getRestrictPosting ( )

Get whether or not submissions are restricted (?)

Returns
bool
Todo:
verify what exactly this corresponds to

◆ getShowMedia()

snuze\Reddit\Thing\Subreddit::getShowMedia ( )

Get whether or not this subreddit has the "show thumbnail images of content" option enabled

Returns
bool

◆ getShowMediaPreview()

snuze\Reddit\Thing\Subreddit::getShowMediaPreview ( )

Get whether or not this subreddit has the "expand media previews on comments pages" option enabled

Returns
bool

◆ getSpoilersEnabled()

snuze\Reddit\Thing\Subreddit::getSpoilersEnabled ( )

Get whether or not this subreddit allows marking links as spoilers

Returns
bool

◆ getSubmissionType()

snuze\Reddit\Thing\Subreddit::getSubmissionType ( )

Get the submission type allowed in this subreddit. Will usually be one of ['any', 'link', 'self'], but some banned and employee-only subreddits may return an empty string

Returns
string

◆ getSubmitLinkLabel()

snuze\Reddit\Thing\Subreddit::getSubmitLinkLabel ( )

Get the text configured for this subreddit's "Custom label for submit link button" option, if any

Returns
string|null

◆ getSubmitText()

snuze\Reddit\Thing\Subreddit::getSubmitText ( )

Get this subreddit's configured "text to show on submission page," if any

Returns
string

◆ getSubmitTextHtml()

snuze\Reddit\Thing\Subreddit::getSubmitTextHtml ( )

Get this subreddit's custom "submit text post" label, if any, as HTML instead of text

Returns
string|null

◆ getSubmitTextLabel()

snuze\Reddit\Thing\Subreddit::getSubmitTextLabel ( )

Get the text configured for this subreddit's "Custom label for submit text post button" option, if any

Returns
string|null

◆ getSubredditType()

snuze\Reddit\Thing\Subreddit::getSubredditType ( )

Get the type of access control enforced on this subreddit. This should be one of ['public', 'restricted', 'private', 'employees_only']

Returns
string

◆ getSubscribers()

snuze\Reddit\Thing\Subreddit::getSubscribers ( )

Get the number of accounts subscribed to this subreddit

Returns
int

◆ getSuggestedCommentSort()

snuze\Reddit\Thing\Subreddit::getSuggestedCommentSort ( )

Get the suggested comment sort order for this subreddit, if one has been set

Returns
string|null

◆ getTitle()

snuze\Reddit\Thing\Subreddit::getTitle ( )

Get this subreddit's title

Returns
string

◆ getUrl()

snuze\Reddit\Thing\Subreddit::getUrl ( )

Get the subreddit name with its fully-qualified relative path e.g. "/r/funny", or "/u/joe" for user profile subreddits

Returns
string

◆ getUserCanFlairInSr()

snuze\Reddit\Thing\Subreddit::getUserCanFlairInSr ( )

Get whether or not the currently authenticated user is allowed to set flair in this subreddit. This will be true if the "Allow users to assign their own" user flair option is enabled, or if the user is a moderator of this subreddit with the "flair" permission. Otherwise, returns null.

Returns
bool|null

◆ getUserFlairBackgroundColor()

snuze\Reddit\Thing\Subreddit::getUserFlairBackgroundColor ( )

Get the HTML hex color code for the currently authenticated user's user flair background in this subreddit, if any

Returns
string|null

◆ getUserFlairCssClass()

snuze\Reddit\Thing\Subreddit::getUserFlairCssClass ( )

Get the CSS class corresponding to the currently authenticated user's user flair on this subreddit

Returns
string|null
Todo:
verify what exactly this corresponds to

◆ getUserFlairEnabledInSr()

snuze\Reddit\Thing\Subreddit::getUserFlairEnabledInSr ( )

Get whether or not user flair is enabled in this subreddit. This applies to the subreddit generally, not to the currently authenticated user.

Returns
bool|null

◆ getUserFlairPosition()

snuze\Reddit\Thing\Subreddit::getUserFlairPosition ( )

Get the CSS position of the currently authenticated user's flair in this subreddit, if any, relative to their username, e.g. "left", "right"

Returns
string

◆ getUserFlairRichtext()

snuze\Reddit\Thing\Subreddit::getUserFlairRichtext ( )

Get the array containing the elements that define the currently authenticated user's flair in this subreddit, if any.

Returns
array

◆ getUserFlairTemplateId()

snuze\Reddit\Thing\Subreddit::getUserFlairTemplateId ( )

Get the 36-character UUID of the currently authenticated user's flair template in this subreddit, if any

Returns
string|null

◆ getUserFlairText()

snuze\Reddit\Thing\Subreddit::getUserFlairText ( )

Get the currently authenticated user's flair text in this subreddit, if any

Returns
string|null

◆ getUserFlairTextColor()

snuze\Reddit\Thing\Subreddit::getUserFlairTextColor ( )

Get the color, either "dark" or "light", of the currently authenticated user's user flair text in this subreddit, if any

Returns
string|null

◆ getUserFlairType()

snuze\Reddit\Thing\Subreddit::getUserFlairType ( )

Get the currently authenticated user's flair type for this subreddit, if any; e.g. "text" or "richtext"

Returns
string

◆ getUserHasFavorited()

snuze\Reddit\Thing\Subreddit::getUserHasFavorited ( )

Get whether or not the currently authenticated user has added this subreddit to their favorites list from its "community details" sidebar widget

Returns
bool

◆ getUserIsBanned()

snuze\Reddit\Thing\Subreddit::getUserIsBanned ( )

Get whether or not the currently authenticated user is banned from participating in this subreddit

Returns
bool

◆ getUserIsContributor()

snuze\Reddit\Thing\Subreddit::getUserIsContributor ( )

Get whether or not the currently authenticated user has been added as an approved user in this subreddit

Returns
bool

◆ getUserIsModerator()

snuze\Reddit\Thing\Subreddit::getUserIsModerator ( )

Get whether or not the currently authenticated user has been added as a moderator in this subreddit

Returns
bool

◆ getUserIsMuted()

snuze\Reddit\Thing\Subreddit::getUserIsMuted ( )

Get whether or not the currently authenticated user has been muted in this subreddit

Returns
bool

◆ getUserIsSubscriber()

snuze\Reddit\Thing\Subreddit::getUserIsSubscriber ( )

Get whether or not the currently authenticated user has subscribed to this subreddit

Returns
bool

◆ getUserSrFlairEnabled()

snuze\Reddit\Thing\Subreddit::getUserSrFlairEnabled ( )

Get whether or not the currently authenticated user has enabled their user flair to be displayed on this subreddit

Returns
bool|null

◆ getUserSrThemeEnabled()

snuze\Reddit\Thing\Subreddit::getUserSrThemeEnabled ( )

Get whether or not the currently authenticated user has enabled this subreddit's custom CSS ("community theme").

Returns
bool

◆ getVideostreamLinksCount()

snuze\Reddit\Thing\Subreddit::getVideostreamLinksCount ( )

Get the number of video streaming links in this subreddit (?) This seems to max out at 100.

Returns
int|null
Todo:
verify what exactly this corresponds to

◆ getWhitelistStatus()

snuze\Reddit\Thing\Subreddit::getWhitelistStatus ( )

Get the advertising whitelist status for this subreddit, if set. This indicates which types of ads are eligible to be displayed.

Returns
string|null

◆ getWikiEnabled()

snuze\Reddit\Thing\Subreddit::getWikiEnabled ( )

Get whether or not the currently authenticated user has access to edit some or all of this subreddit's wiki.

Returns
bool|null

◆ getWls()

snuze\Reddit\Thing\Subreddit::getWls ( )

Get the numeric whitelist status key, if any. A text version of the corresponding whitelist status is available in getWhitelistStatus()

Returns
int|null
See also
getWhitelistStatus()

◆ setAccountsActive()

snuze\Reddit\Thing\Subreddit::setAccountsActive (   $accountsActive = null)
protected

Set the (approximate) number of users interacting with this subreddit over the past 15 minutes.

For some unknown reason, Reddit occasionally returns this as an empty array instead of an integer. It's not reproducible; you can ask for the same subreddit 500 times, and get an integer 499 times, and an empty array once. As a kludge, we accept any type here and cast it to an int; the randomly-encountered empty array will translate to 0.

Parameters
mixed$accountsActive
Returns
$this

◆ setAccountsActiveIsFuzzed()

snuze\Reddit\Thing\Subreddit::setAccountsActiveIsFuzzed ( bool  $accountsActiveIsFuzzed)
protected

Set whether or not accountsActive and activeUserCount values are slightly adjusted to mitigate statistical inference attacks

Parameters
bool$accountsActiveIsFuzzed
Returns
$this

◆ setActiveUserCount()

snuze\Reddit\Thing\Subreddit::setActiveUserCount (   $activeUserCount)
protected

Set the (approximate) number of users interacting with this subreddit.

For some unknown reason, Reddit occasionally returns this as an empty array instead of an integer. It's not reproducible; you can ask for the same subreddit 500 times, and get an integer 499 times, and an empty array once. As a kludge, we accept any type here and cast it to an int; the randomly-encountered empty array will translate to 0.

Parameters
mixed$activeUserCount
Returns
$this

◆ setAdvertiserCategory()

snuze\Reddit\Thing\Subreddit::setAdvertiserCategory ( string  $advertiserCategory)
protected

Set the advertiser category, if any, this subreddit belongs to.

Parameters
string$advertiserCategory
Returns
$this

◆ setAllOriginalContent()

snuze\Reddit\Thing\Subreddit::setAllOriginalContent ( bool  $allOriginalContent)
protected

Set whether or not this subreddit has the "mark all posts in this subreddit as Original Content (OC) on the desktop redesign" option enabled

Parameters
bool$allOriginalContent
Returns
$this

◆ setAllowDiscovery()

snuze\Reddit\Thing\Subreddit::setAllowDiscovery ( bool  $allowDiscovery)
protected

Set whether or not this subreddit has the "allow this subreddit to be exposed to users who have shown intent or interest through discovery and onboarding" option enabled

Parameters
bool$allowDiscovery
Returns
$this

◆ setAllowImages()

snuze\Reddit\Thing\Subreddit::setAllowImages ( bool  $allowImages)
protected

Set whether or not this subreddit has the "allow image uploads and links to image hosting sites" option enabled

Parameters
bool$allowImages
Returns
$this

◆ setAllowVideogifs()

snuze\Reddit\Thing\Subreddit::setAllowVideogifs ( bool  $allowVideogifs)
protected

Set whether or not videogifs are allowed in this subreddit, whatever videogifs are.

Parameters
bool$allowVideogifs
Returns
$this
Todo:
verify what exactly this corresponds to

◆ setAllowVideos()

snuze\Reddit\Thing\Subreddit::setAllowVideos ( bool  $allowVideos)
protected

Set whether or not this subreddit has the "allow video uploads" option enabled

Parameters
bool$allowVideos
Returns
$this

◆ setBannerBackgroundColor()

snuze\Reddit\Thing\Subreddit::setBannerBackgroundColor ( string  $bannerBackgroundColor)
protected

Set the HTML hex color code for this subreddit's banner background, if any

Parameters
string$bannerBackgroundColor
Returns
$this

◆ setBannerBackgroundImage()

snuze\Reddit\Thing\Subreddit::setBannerBackgroundImage ( string  $bannerBackgroundImage)
protected

Set the URL to this subreddit's banner background image, if any. This is the image that displays on the desktop site.

Parameters
string$bannerBackgroundImage
Returns
$this

◆ setBannerImg()

snuze\Reddit\Thing\Subreddit::setBannerImg ( string  $bannerImg)
protected

Set the URL to this subreddit's banner image, if any

Parameters
string$bannerImg
Returns
$this

◆ setBannerSize()

snuze\Reddit\Thing\Subreddit::setBannerSize ( array  $bannerSize = null)
protected

Set the banner image dimensions. This should be an array containing two integer values.

Parameters
array$bannerSize
Returns
$this

◆ setCanAssignLinkFlair()

snuze\Reddit\Thing\Subreddit::setCanAssignLinkFlair ( bool  $canAssignLinkFlair)
protected

Set whether or not users can assign flair to their own links in this subreddit

Parameters
bool$canAssignLinkFlair
Returns
$this

◆ setCanAssignUserFlair()

snuze\Reddit\Thing\Subreddit::setCanAssignUserFlair ( bool  $canAssignUserFlair)
protected

Set whether or not this subreddit allows users to assign flair to themselves

Parameters
bool$canAssignUserFlair
Returns
$this

◆ setCoins()

snuze\Reddit\Thing\Subreddit::setCoins ( int  $coins)

Set this subreddit's Community Awards coin balance.

Parameters
int$coins
Returns
$this

◆ setCollapseDeletedComments()

snuze\Reddit\Thing\Subreddit::setCollapseDeletedComments ( bool  $collapseDeletedComments)
protected

Set whether or not this subreddit has the "collapse deleted and removed comments" option enabled

Parameters
bool$collapseDeletedComments
Returns
$this

◆ setCollectionsEnabled()

snuze\Reddit\Thing\Subreddit::setCollectionsEnabled ( bool  $collectionsEnabled)

Set whether or not this subreddit supports links that are collections of other links

Parameters
bool$collectionsEnabled
Returns
$this

◆ setCommentScoreHideMins()

snuze\Reddit\Thing\Subreddit::setCommentScoreHideMins ( int  $commentScoreHideMins = 0)
protected

Set the "Minutes to hide comment scores" value for this subreddit

Parameters
int$commentScoreHideMins
Returns
$this

◆ setCommunityIcon()

snuze\Reddit\Thing\Subreddit::setCommunityIcon ( string  $communityIcon)
protected

Set the URL to this subreddit's community icon image, if any

Parameters
string$communityIcon
Returns
$this

◆ setContentCategory()

snuze\Reddit\Thing\Subreddit::setContentCategory ( string  $contentCategory)
protected

Set this subreddit's assigned content category, if any

Parameters
string$contentCategory
Returns
$this

◆ setDescription()

snuze\Reddit\Thing\Subreddit::setDescription ( string  $description)
protected

Set this subreddit's description

Parameters
string$description
Returns
$this

◆ setDescriptionHtml()

snuze\Reddit\Thing\Subreddit::setDescriptionHtml ( string  $descriptionHtml = null)
protected

Set this subreddit's description as HTML instead of text

Parameters
string$descriptionHtml
Returns
$this

◆ setDisableContributorRequests()

snuze\Reddit\Thing\Subreddit::setDisableContributorRequests ( bool  $disableContributorRequests)
protected

Set whether or not this subreddit forbids public requests for status as an approved submitter.

Parameters
bool$disableContributorRequests
Returns
$this

◆ setDisplayName()

snuze\Reddit\Thing\Subreddit::setDisplayName ( string  $displayName)
protected

Set the display name of the subreddit e.g. "funny". The supplied name is checked against known subreddit name restrictions.

Parameters
string$displayName
Exceptions

◆ setDisplayNamePrefixed()

snuze\Reddit\Thing\Subreddit::setDisplayNamePrefixed ( string  $displayNamePrefixed)
protected

Set the subreddit name with its relative path e.g. "r/funny", or "u/joe" for user profile subreddits

Parameters
string$displayNamePrefixed
Returns
$this

◆ setEmojisCustomSize()

snuze\Reddit\Thing\Subreddit::setEmojisCustomSize ( array  $emojisCustomSize = null)
protected

Set the emoji image dimensions. This should be an array containing two integer values.

Parameters
array$emojisCustomSize
Returns
$this

◆ setEmojisEnabled()

snuze\Reddit\Thing\Subreddit::setEmojisEnabled ( bool  $emojisEnabled)
protected

Set whether or not custom emojis are enabled for this subreddit

Parameters
bool$emojisEnabled
Returns
$this

◆ setEventPostsEnabled()

snuze\Reddit\Thing\Subreddit::setEventPostsEnabled ( bool  $eventPostsEnabled)

Set whether or not this subreddit supports links that are event posts

Parameters
bool$eventPostsEnabled
Returns
$this

◆ setFreeFormReports()

snuze\Reddit\Thing\Subreddit::setFreeFormReports ( bool  $freeFormReports)
protected

Set whether or not this subreddit has the "allow free-form reports by users" option enabled

Parameters
bool$freeFormReports
Returns
$this

◆ setHasMenuWidget()

snuze\Reddit\Thing\Subreddit::setHasMenuWidget ( bool  $hasMenuWidget)
protected

Set whether or not this subreddit has custom menu tabs defined by a moderator.

Parameters
bool$hasMenuWidget
Returns
$this

◆ setHeaderImg()

snuze\Reddit\Thing\Subreddit::setHeaderImg ( string  $headerImg = null)
protected

Set the URL to this subreddit's header image, if any. This is the image that appears in place of Snoo on the old style Reddit.

Parameters
string$headerImg
Returns
$this

◆ setHeaderSize()

snuze\Reddit\Thing\Subreddit::setHeaderSize ( array  $headerSize = null)
protected

Set the header image dimensions. This should be an array containing two integer values.

Parameters
array$headerSize
Returns
$this

◆ setHeaderTitle()

snuze\Reddit\Thing\Subreddit::setHeaderTitle ( string  $headerTitle = null)
protected

Set the title/alt text of this subreddit's header image, if any

Parameters
string$headerTitle
Returns
$this

◆ setHideAds()

snuze\Reddit\Thing\Subreddit::setHideAds ( bool  $hideAds)
protected

Set whether or not ads have been administratively suppressed in this subreddit

Parameters
bool$hideAds
Returns
$this

◆ setIconImg()

snuze\Reddit\Thing\Subreddit::setIconImg ( string  $iconImg)
protected

Set the URL to this subreddit's icon image, if any. This icon is displayed in the "Community Details" portion of the sidebar and in public "card" style listings, both on the redesign interface.

Parameters
string$iconImg
Returns
$this

◆ setIconSize()

snuze\Reddit\Thing\Subreddit::setIconSize ( array  $iconSize = null)
protected

Set the icon image dimensions. This should be an array containing two integer values.

Parameters
array$iconSize
Returns
$this

◆ setIsCrosspostableSubreddit()

snuze\Reddit\Thing\Subreddit::setIsCrosspostableSubreddit ( bool  $isCrosspostableSubreddit = null)

Set whether or not this subreddit has the "Allow crossposting of posts" preference enabled.

Parameters
bool$isCrosspostableSubreddit
Returns
$this

◆ setIsEnrolledInNewModmail()

snuze\Reddit\Thing\Subreddit::setIsEnrolledInNewModmail ( bool  $isEnrolledInNewModmail = null)
protected

Set whether or not this subreddit uses the new modmail system

Parameters
bool$isEnrolledInNewModmail
Returns
$this

◆ setKeyColor()

snuze\Reddit\Thing\Subreddit::setKeyColor ( string  $keyColor)
protected

Set the HTML hex color code for this subreddit's general theme color. Corresponds to the "used as a thematic color for your subreddit on mobile" option.

Parameters
string$keyColor
Returns
$this

◆ setLang()

snuze\Reddit\Thing\Subreddit::setLang ( string  $lang)
protected

Set the language code for this subreddit, if any; e.g. "en" or "pt-pt"

Parameters
string$lang
Returns
$this

◆ setLinkFlairEnabled()

snuze\Reddit\Thing\Subreddit::setLinkFlairEnabled ( bool  $linkFlairEnabled)
protected

Set whether or not link flair is supported in this subreddit

Parameters
bool$linkFlairEnabled
Returns
$this

◆ setLinkFlairPosition()

snuze\Reddit\Thing\Subreddit::setLinkFlairPosition ( string  $linkFlairPosition)
protected

Set the CSS position of a link's flair in this subreddit, if any, relative to the link, e.g. "left", "right"

Parameters
string$linkFlairPosition
Returns
$this

◆ setMobileBannerImage()

snuze\Reddit\Thing\Subreddit::setMobileBannerImage ( string  $mobileBannerImage)
protected

Set the URL to this subreddit's mobile banner image, if any

Parameters
string$mobileBannerImage
Returns
$this

◆ setName()

snuze\Reddit\Thing\Subreddit::setName ( string  $name)
protected

Set the Reddit fullname identifier of this subreddit e.g. "t5_2qh33". If you want the subreddit display name e.g. "funny", use setDisplayName() instead.

Parameters
string$name
Returns
$this

◆ setNotificationLevel()

snuze\Reddit\Thing\Subreddit::setNotificationLevel ( string  $notificationLevel = null)
protected

Set the notification level (?)

Parameters
string$notificationLevel
Returns
$this
Todo:
verify what exactly this corresponds to

◆ setOriginalContentTagEnabled()

snuze\Reddit\Thing\Subreddit::setOriginalContentTagEnabled ( bool  $originalContentTagEnabled)
protected

Set whether or not this subreddit has the "enable marking posts as Original Content (OC) on the desktop redesign" option enabled

Parameters
bool$originalContentTagEnabled
Returns
$this

◆ setOver18()

snuze\Reddit\Thing\Subreddit::setOver18 ( bool  $over18)
protected

Set whether or not this subreddit has the "viewers must be over eighteen years old" option enabled

Parameters
bool$over18
Returns
$this

◆ setPrimaryColor()

snuze\Reddit\Thing\Subreddit::setPrimaryColor ( string  $primaryColor)
protected

Set the HTML hex color code for this subreddit's primary color, if any. This corresponds to the "Base" theme color in the redesign subreddit manager interface.

Parameters
string$primaryColor
Returns
$this

◆ setPublicDescription()

snuze\Reddit\Thing\Subreddit::setPublicDescription ( string  $publicDescription)
protected

Set the external description for this subreddit, if any. This is used in <meta name="description"> tags, and in subreddit search results; it's distinct from the sidebar description, which can be set using getDescription()

Parameters
string$publicDescription
Returns
$this
See also
setDescription()

◆ setPublicDescriptionHtml()

snuze\Reddit\Thing\Subreddit::setPublicDescriptionHtml ( string  $publicDescriptionHtml)
protected

Set the external description for this subreddit, if any, as HTML instead of text

Parameters
string$publicDescriptionHtml
Returns
$this

◆ setPublicTraffic()

snuze\Reddit\Thing\Subreddit::setPublicTraffic ( bool  $publicTraffic)
protected

Set whether or not this subreddit exposes its traffic stats to the public

Parameters
bool$publicTraffic
Returns
$this

◆ setQuarantine()

snuze\Reddit\Thing\Subreddit::setQuarantine ( bool  $quarantine)
protected

Set whether or not this subreddit is quarantined

Parameters
bool$quarantine
Returns
$this

◆ setRestrictCommenting()

snuze\Reddit\Thing\Subreddit::setRestrictCommenting ( bool  $restrictCommenting)
protected

Set whether or not commenting is restricted (?)

Parameters
bool$restrictCommenting
Returns
$this
Todo:
verify what exactly this corresponds to

◆ setRestrictPosting()

snuze\Reddit\Thing\Subreddit::setRestrictPosting ( bool  $restrictPosting)
protected

Set whether or not submissions are restricted (?)

Parameters
bool$restrictPosting
Returns
$this

◆ setShowMedia()

snuze\Reddit\Thing\Subreddit::setShowMedia ( bool  $showMedia)
protected

Set whether or not this subreddit has the "show thumbnail images of content" option enabled

Parameters
bool$showMedia
Returns
$this

◆ setShowMediaPreview()

snuze\Reddit\Thing\Subreddit::setShowMediaPreview ( bool  $showMediaPreview)
protected

Set whether or not this subreddit has the "expand media previews on comments pages" option enabled

Parameters
bool$showMediaPreview
Returns
$this

◆ setSpoilersEnabled()

snuze\Reddit\Thing\Subreddit::setSpoilersEnabled ( bool  $spoilersEnabled)
protected

Set whether or not this subreddit allows marking links as spoilers

Parameters
bool$spoilersEnabled
Returns
$this

◆ setSubmissionType()

snuze\Reddit\Thing\Subreddit::setSubmissionType ( string  $submissionType)
protected

Set the submission type allowed in this subreddit

Parameters
string$submissionType
Returns
$this

◆ setSubmitLinkLabel()

snuze\Reddit\Thing\Subreddit::setSubmitLinkLabel ( string  $submitLinkLabel = null)
protected

Set the text configured for this subreddit's "Custom label for submit link button" option, if any

Parameters
string$submitLinkLabel
Returns
$this

◆ setSubmitText()

snuze\Reddit\Thing\Subreddit::setSubmitText ( string  $submitText)
protected

Set this subreddit's configured "text to show on submission page," if any

Parameters
string$submitText
Returns
$this

◆ setSubmitTextHtml()

snuze\Reddit\Thing\Subreddit::setSubmitTextHtml ( string  $submitTextHtml = null)
protected

Get this subreddit's custom "submit text post" label, if any, as HTML instead of text

Parameters
string$submitTextHtml
Returns
$this

◆ setSubmitTextLabel()

snuze\Reddit\Thing\Subreddit::setSubmitTextLabel ( string  $submitTextLabel = null)
protected

Set the text configured for this subreddit's "Custom label for submit text post button" option, if any

Parameters
string$submitTextLabel
Returns
$this

◆ setSubredditType()

snuze\Reddit\Thing\Subreddit::setSubredditType ( string  $subredditType)
protected

Set the type of access control enforced on this subreddit. This should be one of ['public', 'restricted', 'private', 'employees_only']

Parameters
string$subredditType
Returns
$this

◆ setSubscribers()

snuze\Reddit\Thing\Subreddit::setSubscribers ( int  $subscribers)
protected

Set the number of accounts subscribed to this subreddit

Parameters
int$subscribers
Returns
$this

◆ setSuggestedCommentSort()

snuze\Reddit\Thing\Subreddit::setSuggestedCommentSort ( string  $suggestedCommentSort = null)
protected

Set the suggested comment sort order for this subreddit

Parameters
string$suggestedCommentSort
Returns
$this

◆ setTitle()

snuze\Reddit\Thing\Subreddit::setTitle ( string  $title)
protected

Set this subreddit's title

Parameters
string$title
Returns
$this

◆ setUrl()

snuze\Reddit\Thing\Subreddit::setUrl ( string  $url)
protected

Set the subreddit name with its fully-qualified relative path e.g. "/r/funny", or "/u/joe" for user profile subreddits

Parameters
string$url
Returns
$this

◆ setUserCanFlairInSr()

snuze\Reddit\Thing\Subreddit::setUserCanFlairInSr ( bool  $userCanFlairInSr = null)
protected

Set whether or not the currently authenticated user is allowed to set flair in this subreddit

Parameters
bool$userCanFlairInSr
Returns
$this

◆ setUserFlairBackgroundColor()

snuze\Reddit\Thing\Subreddit::setUserFlairBackgroundColor ( string  $userFlairBackgroundColor = null)
protected

Set the HTML hex color code for the currently authenticated user's user flair background in this subreddit, if any

Parameters
string$userFlairBackgroundColor
Returns
$this

◆ setUserFlairCssClass()

snuze\Reddit\Thing\Subreddit::setUserFlairCssClass ( string  $userFlairCssClass = null)
protected

Set the CSS class corresponding to the currently authenticated user's user flair on this subreddit

Parameters
string$userFlairCssClass
Returns
$this
Todo:
verify what exactly this corresponds to

◆ setUserFlairEnabledInSr()

snuze\Reddit\Thing\Subreddit::setUserFlairEnabledInSr ( bool  $userFlairEnabledInSr = null)
protected

Set whether or not user flair is enabled in this subreddit. This applies to the subreddit generally, not to the currently authenticated user.

Parameters
bool$userFlairEnabledInSr
Returns
$this

◆ setUserFlairPosition()

snuze\Reddit\Thing\Subreddit::setUserFlairPosition ( string  $userFlairPosition)
protected

Set the CSS position of the currently authenticated user's flair in this subreddit, if any, relative to their username, e.g. "left", "right"

Parameters
string$userFlairPosition
Returns
$this

◆ setUserFlairRichtext()

snuze\Reddit\Thing\Subreddit::setUserFlairRichtext ( array  $userFlairRichtext)
protected

Set the array containing the elements that define the currently authenticated user's flair in this subreddit, if any.

Parameters
array$userFlairRichtext
Returns
$this

◆ setUserFlairTemplateId()

snuze\Reddit\Thing\Subreddit::setUserFlairTemplateId ( string  $userFlairTemplateId = null)
protected

Set the 36-character UUID of the currently authenticated user's flair template in this subreddit, if any

Parameters
string$userFlairTemplateId
Returns
$this

◆ setUserFlairText()

snuze\Reddit\Thing\Subreddit::setUserFlairText ( string  $userFlairText = null)
protected

Set the currently authenticated user's flair text in this subreddit, if any

Parameters
string$userFlairText
Returns
$this

◆ setUserFlairTextColor()

snuze\Reddit\Thing\Subreddit::setUserFlairTextColor ( string  $userFlairTextColor = null)
protected

Set the color, either "dark" or "light", of the currently authenticated user's user flair text in this subreddit, if any

Parameters
string$userFlairTextColorMust be "dark" or "light"
Returns
$this

◆ setUserFlairType()

snuze\Reddit\Thing\Subreddit::setUserFlairType ( string  $userFlairType)
protected

Set the currently authenticated user's flair type for this subreddit, if any; e.g. "text" or "richtext"

Parameters
string$userFlairType
Returns
$this

◆ setUserHasFavorited()

snuze\Reddit\Thing\Subreddit::setUserHasFavorited ( bool  $userHasFavorited)
protected

Set whether or not the currently authenticated user has added this subreddit to their favorites list from its "community details" sidebar widget

Parameters
bool$userHasFavorited
Returns
$this

◆ setUserIsBanned()

snuze\Reddit\Thing\Subreddit::setUserIsBanned ( bool  $userIsBanned)
protected

Set whether or not the currently authenticated user is banned from participating in this subreddit

Parameters
bool$userIsBanned
Returns
$this

◆ setUserIsContributor()

snuze\Reddit\Thing\Subreddit::setUserIsContributor ( bool  $userIsContributor)
protected

Set whether or not the currently authenticated user has been added as an approved user in this subreddit

Parameters
bool$userIsContributor
Returns
$this

◆ setUserIsModerator()

snuze\Reddit\Thing\Subreddit::setUserIsModerator ( bool  $userIsModerator)
protected

Set whether or not the currently authenticated user has been added as a moderator in this subreddit

Parameters
bool$userIsModerator
Returns
$this

◆ setUserIsMuted()

snuze\Reddit\Thing\Subreddit::setUserIsMuted ( bool  $userIsMuted)
protected

Set whether or not the currently authenticated user has been muted in this subreddit

Parameters
bool$userIsMuted
Returns
$this

◆ setUserIsSubscriber()

snuze\Reddit\Thing\Subreddit::setUserIsSubscriber ( bool  $userIsSubscriber)
protected

Set whether or not the currently authenticated user has subscribed to this subreddit

Parameters
bool$userIsSubscriber
Returns
$this

◆ setUserSrFlairEnabled()

snuze\Reddit\Thing\Subreddit::setUserSrFlairEnabled ( bool  $userSrFlairEnabled = null)
protected

Set whether or not the currently authenticated user has enabled their user flair to be displayed on this subreddit

Parameters
bool$userSrFlairEnabled
Returns
$this

◆ setUserSrThemeEnabled()

snuze\Reddit\Thing\Subreddit::setUserSrThemeEnabled ( bool  $userSrThemeEnabled)
protected

Set whether or not the currently authenticated user has enabled this subreddit's custom CSS ("community theme")

Parameters
bool$userSrThemeEnabled
Returns
$this

◆ setVideostreamLinksCount()

snuze\Reddit\Thing\Subreddit::setVideostreamLinksCount ( int  $videostreamLinksCount = null)
protected

Set the number of video streaming links in this subreddit (?) This seems to max out at 100.

Parameters
int$videostreamLinksCount
Returns
$this
Todo:
verify what exactly this corresponds to

◆ setWhitelistStatus()

snuze\Reddit\Thing\Subreddit::setWhitelistStatus ( string  $whitelistStatus = null)
protected

Set the advertising whitelist status for this subreddit, if set. This indicates which types of ads are eligible to be displayed.

Parameters
string$whitelistStatus
Returns
$this

◆ setWikiEnabled()

snuze\Reddit\Thing\Subreddit::setWikiEnabled ( bool  $wikiEnabled = null)
protected

Set whether or not the currently authenticated user has access to edit some or all of this subreddit's wiki.

Parameters
bool$wikiEnabled
Returns
$this

◆ setWls()

snuze\Reddit\Thing\Subreddit::setWls ( int  $wls = null)
protected

Set the numeric whitelist status key, if any

Parameters
int$wls
Returns
$this
See also
setWhitelistStatus()

Member Data Documentation

◆ REGEX_VALID_NAME

const snuze\Reddit\Thing\Subreddit::REGEX_VALID_NAME = '/^((?:[a-z0-9](?:[a-z0-9_]){2,20})|reddit\.com|ca|de|es|eu|fr|it|ja|nl|pl|ru)$/i'

A regular expression used to test whether or not a subreddit name is valid. Subreddit names must be between 3 and 21 characters long, contain only alphanumerics and underscores, and can't start with an underscore. There are several grandfathered exceptions, which are considered here.


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