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' |
![]() | |
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) | |
![]() | |
setId (string $id) | |
setKind (string $kind) | |
setCreated (float $created) | |
setCreatedUtc (float $createdUtc) | |
getPropertyTranslationMap () | |
![]() | |
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 | |
![]() | |
$_kind = null | |
$_propertyNames = [] | |
$_propertyTranslationRegex = '|([a-z])([A-Z0-9])|' | |
$_sourceJson = '' | |
$id = null | |
$created = 0.0 | |
$createdUtc = 0.0 | |
![]() | |
$_snuzeId = null | |
$_snuzeClass = null | |
Additional Inherited Members | |
![]() | |
static | getValidKinds () |
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 @sha unc.c omhttps://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.
snuze\Reddit\Thing\Subreddit::__construct | ( | ) |
Constructor.
References snuze\Reddit\Thing\Thing\KIND_SUBREDDIT.
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.
snuze\Reddit\Thing\Subreddit::getAccountsActiveIsFuzzed | ( | ) |
Get whether or not accountsActive and activeUserCount values are slightly adjusted to mitigate statistical inference attacks
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.
snuze\Reddit\Thing\Subreddit::getAdvertiserCategory | ( | ) |
Get the advertiser category, if any, this subreddit belongs to.
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
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
snuze\Reddit\Thing\Subreddit::getAllowImages | ( | ) |
Get whether or not this subreddit has the "allow image uploads and links to image hosting sites" option enabled
snuze\Reddit\Thing\Subreddit::getAllowVideogifs | ( | ) |
Get whether or not videogifs are allowed in this subreddit, whatever videogifs are.
snuze\Reddit\Thing\Subreddit::getAllowVideos | ( | ) |
Get whether or not this subreddit has the "allow video uploads" option enabled
snuze\Reddit\Thing\Subreddit::getBannerBackgroundColor | ( | ) |
Get the HTML hex color code for this subreddit's banner background, if any
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.
snuze\Reddit\Thing\Subreddit::getBannerImg | ( | ) |
Get the URL to this subreddit's banner image, if any.
snuze\Reddit\Thing\Subreddit::getBannerSize | ( | ) |
Get the banner image dimensions. If set, this will be an array containing two integer values.
snuze\Reddit\Thing\Subreddit::getCanAssignLinkFlair | ( | ) |
Get whether or not users can assign flair to their own links in this subreddit
snuze\Reddit\Thing\Subreddit::getCanAssignUserFlair | ( | ) |
Get whether or not this subreddit allows users to assign flair to themselves
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.
snuze\Reddit\Thing\Subreddit::getCollapseDeletedComments | ( | ) |
Get whether or not this subreddit has the "collapse deleted and removed comments" option enabled
snuze\Reddit\Thing\Subreddit::getCollectionsEnabled | ( | ) |
Get whether or not this subreddit supports links that are collections of other links
snuze\Reddit\Thing\Subreddit::getCommentScoreHideMins | ( | ) |
Get the "Minutes to hide comment scores" value for this subreddit
snuze\Reddit\Thing\Subreddit::getCommunityIcon | ( | ) |
Get the URL to this subreddit's community icon image, if any
snuze\Reddit\Thing\Subreddit::getContentCategory | ( | ) |
Get this subreddit's assigned content category, if any
snuze\Reddit\Thing\Subreddit::getDescription | ( | ) |
Get this subreddit's description
snuze\Reddit\Thing\Subreddit::getDescriptionHtml | ( | ) |
Get this subreddit's description as HTML instead of text
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.)
snuze\Reddit\Thing\Subreddit::getDisplayName | ( | ) |
Get the undecorated display name of the subreddit e.g. "funny"
snuze\Reddit\Thing\Subreddit::getDisplayNamePrefixed | ( | ) |
Get the subreddit name with its relative path e.g. "r/funny", or "u/joe" for user profile subreddits
snuze\Reddit\Thing\Subreddit::getEmojisCustomSize | ( | ) |
Get the emoji image dimensions. If set, this will be an array containing two integer values.
snuze\Reddit\Thing\Subreddit::getEmojisEnabled | ( | ) |
Get whether or not custom emojis are enabled for this subreddit
snuze\Reddit\Thing\Subreddit::getEventPostsEnabled | ( | ) |
Get whether or not this subreddit supports links that are event posts
snuze\Reddit\Thing\Subreddit::getFreeFormReports | ( | ) |
Get whether or not this subreddit has the "allow free-form reports by users" option enabled
snuze\Reddit\Thing\Subreddit::getHasMenuWidget | ( | ) |
Get whether or not this subreddit has custom menu tabs defined by a moderator.
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.
snuze\Reddit\Thing\Subreddit::getHeaderSize | ( | ) |
Get the header image dimensions. If set, this will be an array containing two integer values.
snuze\Reddit\Thing\Subreddit::getHeaderTitle | ( | ) |
Get the title/alt text of this subreddit's header image, if any
snuze\Reddit\Thing\Subreddit::getHideAds | ( | ) |
Get whether or not ads have been administratively suppressed in this subreddit
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.
snuze\Reddit\Thing\Subreddit::getIconSize | ( | ) |
Get the icon image dimensions. If set, this will be an array containing two integer values.
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.
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.
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.
snuze\Reddit\Thing\Subreddit::getLang | ( | ) |
Get the language code for this subreddit, if any; e.g. "en" or "pt-pt"
snuze\Reddit\Thing\Subreddit::getLinkFlairEnabled | ( | ) |
Get whether or not link flair is supported in this subreddit
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"
snuze\Reddit\Thing\Subreddit::getMobileBannerImage | ( | ) |
Get the URL to this subreddit's mobile banner image, if any
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.
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.
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
snuze\Reddit\Thing\Subreddit::getOver18 | ( | ) |
Get whether or not this subreddit has the "viewers must be over eighteen years old" option enabled
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.
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()
snuze\Reddit\Thing\Subreddit::getPublicDescriptionHtml | ( | ) |
Get the external description for this subreddit, if any, as HTML instead of text
snuze\Reddit\Thing\Subreddit::getPublicTraffic | ( | ) |
Get whether or not this subreddit exposes its traffic stats to the public
snuze\Reddit\Thing\Subreddit::getQuarantine | ( | ) |
Get whether or not this subreddit is quarantined
snuze\Reddit\Thing\Subreddit::getRestrictCommenting | ( | ) |
Get whether or not commenting is restricted (?)
snuze\Reddit\Thing\Subreddit::getRestrictPosting | ( | ) |
Get whether or not submissions are restricted (?)
snuze\Reddit\Thing\Subreddit::getShowMedia | ( | ) |
Get whether or not this subreddit has the "show thumbnail images of content" option enabled
snuze\Reddit\Thing\Subreddit::getShowMediaPreview | ( | ) |
Get whether or not this subreddit has the "expand media previews on comments pages" option enabled
snuze\Reddit\Thing\Subreddit::getSpoilersEnabled | ( | ) |
Get whether or not this subreddit allows marking links as spoilers
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
snuze\Reddit\Thing\Subreddit::getSubmitLinkLabel | ( | ) |
Get the text configured for this subreddit's "Custom label for submit link button" option, if any
snuze\Reddit\Thing\Subreddit::getSubmitText | ( | ) |
Get this subreddit's configured "text to show on submission page," if any
snuze\Reddit\Thing\Subreddit::getSubmitTextHtml | ( | ) |
Get this subreddit's custom "submit text post" label, if any, as HTML instead of text
snuze\Reddit\Thing\Subreddit::getSubmitTextLabel | ( | ) |
Get the text configured for this subreddit's "Custom label for submit text post button" option, if any
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']
snuze\Reddit\Thing\Subreddit::getSubscribers | ( | ) |
Get the number of accounts subscribed to this subreddit
snuze\Reddit\Thing\Subreddit::getSuggestedCommentSort | ( | ) |
Get the suggested comment sort order for this subreddit, if one has been set
snuze\Reddit\Thing\Subreddit::getTitle | ( | ) |
Get this subreddit's title
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
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.
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
snuze\Reddit\Thing\Subreddit::getUserFlairCssClass | ( | ) |
Get the CSS class corresponding to the currently authenticated user's user flair on this subreddit
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.
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"
snuze\Reddit\Thing\Subreddit::getUserFlairRichtext | ( | ) |
Get the array containing the elements that define the currently authenticated user's flair in this subreddit, if any.
snuze\Reddit\Thing\Subreddit::getUserFlairTemplateId | ( | ) |
Get the 36-character UUID of the currently authenticated user's flair template in this subreddit, if any
snuze\Reddit\Thing\Subreddit::getUserFlairText | ( | ) |
Get the currently authenticated user's flair text in this subreddit, if any
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
snuze\Reddit\Thing\Subreddit::getUserFlairType | ( | ) |
Get the currently authenticated user's flair type for this subreddit, if any; e.g. "text" or "richtext"
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
snuze\Reddit\Thing\Subreddit::getUserIsBanned | ( | ) |
Get whether or not the currently authenticated user is banned from participating in this subreddit
snuze\Reddit\Thing\Subreddit::getUserIsContributor | ( | ) |
Get whether or not the currently authenticated user has been added as an approved user in this subreddit
snuze\Reddit\Thing\Subreddit::getUserIsModerator | ( | ) |
Get whether or not the currently authenticated user has been added as a moderator in this subreddit
snuze\Reddit\Thing\Subreddit::getUserIsMuted | ( | ) |
Get whether or not the currently authenticated user has been muted in this subreddit
snuze\Reddit\Thing\Subreddit::getUserIsSubscriber | ( | ) |
Get whether or not the currently authenticated user has subscribed to this subreddit
snuze\Reddit\Thing\Subreddit::getUserSrFlairEnabled | ( | ) |
Get whether or not the currently authenticated user has enabled their user flair to be displayed on this subreddit
snuze\Reddit\Thing\Subreddit::getUserSrThemeEnabled | ( | ) |
Get whether or not the currently authenticated user has enabled this subreddit's custom CSS ("community theme").
snuze\Reddit\Thing\Subreddit::getVideostreamLinksCount | ( | ) |
Get the number of video streaming links in this subreddit (?) This seems to max out at 100.
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.
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.
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()
|
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.
mixed | $accountsActive |
|
protected |
Set whether or not accountsActive and activeUserCount values are slightly adjusted to mitigate statistical inference attacks
bool | $accountsActiveIsFuzzed |
|
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.
mixed | $activeUserCount |
|
protected |
Set the advertiser category, if any, this subreddit belongs to.
string | $advertiserCategory |
|
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
bool | $allOriginalContent |
|
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
bool | $allowDiscovery |
|
protected |
Set whether or not this subreddit has the "allow image uploads and links to image hosting sites" option enabled
bool | $allowImages |
|
protected |
Set whether or not videogifs are allowed in this subreddit, whatever videogifs are.
bool | $allowVideogifs |
|
protected |
Set whether or not this subreddit has the "allow video uploads" option enabled
bool | $allowVideos |
|
protected |
Set the HTML hex color code for this subreddit's banner background, if any
string | $bannerBackgroundColor |
|
protected |
Set the URL to this subreddit's banner background image, if any. This is the image that displays on the desktop site.
string | $bannerBackgroundImage |
|
protected |
Set the URL to this subreddit's banner image, if any
string | $bannerImg |
|
protected |
Set the banner image dimensions. This should be an array containing two integer values.
array | $bannerSize |
|
protected |
Set whether or not users can assign flair to their own links in this subreddit
bool | $canAssignLinkFlair |
|
protected |
Set whether or not this subreddit allows users to assign flair to themselves
bool | $canAssignUserFlair |
snuze\Reddit\Thing\Subreddit::setCoins | ( | int | $coins | ) |
Set this subreddit's Community Awards coin balance.
int | $coins |
|
protected |
Set whether or not this subreddit has the "collapse deleted and removed comments" option enabled
bool | $collapseDeletedComments |
snuze\Reddit\Thing\Subreddit::setCollectionsEnabled | ( | bool | $collectionsEnabled | ) |
Set whether or not this subreddit supports links that are collections of other links
bool | $collectionsEnabled |
|
protected |
Set the "Minutes to hide comment scores" value for this subreddit
int | $commentScoreHideMins |
|
protected |
Set the URL to this subreddit's community icon image, if any
string | $communityIcon |
|
protected |
Set this subreddit's assigned content category, if any
string | $contentCategory |
|
protected |
Set this subreddit's description
string | $description |
|
protected |
Set this subreddit's description as HTML instead of text
string | $descriptionHtml |
|
protected |
Set whether or not this subreddit forbids public requests for status as an approved submitter.
bool | $disableContributorRequests |
|
protected |
Set the display name of the subreddit e.g. "funny". The supplied name is checked against known subreddit name restrictions.
string | $displayName |
|
protected |
Set the subreddit name with its relative path e.g. "r/funny", or "u/joe" for user profile subreddits
string | $displayNamePrefixed |
|
protected |
Set the emoji image dimensions. This should be an array containing two integer values.
array | $emojisCustomSize |
|
protected |
Set whether or not custom emojis are enabled for this subreddit
bool | $emojisEnabled |
snuze\Reddit\Thing\Subreddit::setEventPostsEnabled | ( | bool | $eventPostsEnabled | ) |
Set whether or not this subreddit supports links that are event posts
bool | $eventPostsEnabled |
|
protected |
Set whether or not this subreddit has the "allow free-form reports by users" option enabled
bool | $freeFormReports |
|
protected |
Set whether or not this subreddit has custom menu tabs defined by a moderator.
bool | $hasMenuWidget |
|
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.
string | $headerImg |
|
protected |
Set the header image dimensions. This should be an array containing two integer values.
array | $headerSize |
|
protected |
Set the title/alt text of this subreddit's header image, if any
string | $headerTitle |
|
protected |
Set whether or not ads have been administratively suppressed in this subreddit
bool | $hideAds |
|
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.
string | $iconImg |
|
protected |
Set the icon image dimensions. This should be an array containing two integer values.
array | $iconSize |
snuze\Reddit\Thing\Subreddit::setIsCrosspostableSubreddit | ( | bool | $isCrosspostableSubreddit = null | ) |
Set whether or not this subreddit has the "Allow crossposting of posts" preference enabled.
bool | $isCrosspostableSubreddit |
|
protected |
Set whether or not this subreddit uses the new modmail system
bool | $isEnrolledInNewModmail |
|
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.
string | $keyColor |
|
protected |
Set the language code for this subreddit, if any; e.g. "en" or "pt-pt"
string | $lang |
|
protected |
Set whether or not link flair is supported in this subreddit
bool | $linkFlairEnabled |
|
protected |
Set the CSS position of a link's flair in this subreddit, if any, relative to the link, e.g. "left", "right"
string | $linkFlairPosition |
|
protected |
Set the URL to this subreddit's mobile banner image, if any
string | $mobileBannerImage |
|
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.
string | $name |
|
protected |
Set the notification level (?)
string | $notificationLevel |
|
protected |
Set whether or not this subreddit has the "enable marking posts as Original Content (OC) on the desktop redesign" option enabled
bool | $originalContentTagEnabled |
|
protected |
Set whether or not this subreddit has the "viewers must be over eighteen years old" option enabled
bool | $over18 |
|
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.
string | $primaryColor |
|
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()
string | $publicDescription |
|
protected |
Set the external description for this subreddit, if any, as HTML instead of text
string | $publicDescriptionHtml |
|
protected |
Set whether or not this subreddit exposes its traffic stats to the public
bool | $publicTraffic |
|
protected |
Set whether or not this subreddit is quarantined
bool | $quarantine |
|
protected |
Set whether or not commenting is restricted (?)
bool | $restrictCommenting |
|
protected |
Set whether or not submissions are restricted (?)
bool | $restrictPosting |
|
protected |
Set whether or not this subreddit has the "show thumbnail images of content" option enabled
bool | $showMedia |
|
protected |
Set whether or not this subreddit has the "expand media previews on comments pages" option enabled
bool | $showMediaPreview |
|
protected |
Set whether or not this subreddit allows marking links as spoilers
bool | $spoilersEnabled |
|
protected |
Set the submission type allowed in this subreddit
string | $submissionType |
|
protected |
Set the text configured for this subreddit's "Custom label for submit link button" option, if any
string | $submitLinkLabel |
|
protected |
Set this subreddit's configured "text to show on submission page," if any
string | $submitText |
|
protected |
Get this subreddit's custom "submit text post" label, if any, as HTML instead of text
string | $submitTextHtml |
|
protected |
Set the text configured for this subreddit's "Custom label for submit text post button" option, if any
string | $submitTextLabel |
|
protected |
Set the type of access control enforced on this subreddit. This should be one of ['public', 'restricted', 'private', 'employees_only']
string | $subredditType |
|
protected |
Set the number of accounts subscribed to this subreddit
int | $subscribers |
|
protected |
Set the suggested comment sort order for this subreddit
string | $suggestedCommentSort |
|
protected |
Set this subreddit's title
string | $title |
|
protected |
Set the subreddit name with its fully-qualified relative path e.g. "/r/funny", or "/u/joe" for user profile subreddits
string | $url |
|
protected |
Set whether or not the currently authenticated user is allowed to set flair in this subreddit
bool | $userCanFlairInSr |
|
protected |
Set the HTML hex color code for the currently authenticated user's user flair background in this subreddit, if any
string | $userFlairBackgroundColor |
|
protected |
Set the CSS class corresponding to the currently authenticated user's user flair on this subreddit
string | $userFlairCssClass |
|
protected |
Set whether or not user flair is enabled in this subreddit. This applies to the subreddit generally, not to the currently authenticated user.
bool | $userFlairEnabledInSr |
|
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"
string | $userFlairPosition |
|
protected |
Set the array containing the elements that define the currently authenticated user's flair in this subreddit, if any.
array | $userFlairRichtext |
|
protected |
Set the 36-character UUID of the currently authenticated user's flair template in this subreddit, if any
string | $userFlairTemplateId |
|
protected |
Set the currently authenticated user's flair text in this subreddit, if any
string | $userFlairText |
|
protected |
Set the color, either "dark" or "light", of the currently authenticated user's user flair text in this subreddit, if any
string | $userFlairTextColor | Must be "dark" or "light" |
|
protected |
Set the currently authenticated user's flair type for this subreddit, if any; e.g. "text" or "richtext"
string | $userFlairType |
|
protected |
Set whether or not the currently authenticated user has added this subreddit to their favorites list from its "community details" sidebar widget
bool | $userHasFavorited |
|
protected |
Set whether or not the currently authenticated user is banned from participating in this subreddit
bool | $userIsBanned |
|
protected |
Set whether or not the currently authenticated user has been added as an approved user in this subreddit
bool | $userIsContributor |
|
protected |
Set whether or not the currently authenticated user has been added as a moderator in this subreddit
bool | $userIsModerator |
|
protected |
Set whether or not the currently authenticated user has been muted in this subreddit
bool | $userIsMuted |
|
protected |
Set whether or not the currently authenticated user has subscribed to this subreddit
bool | $userIsSubscriber |
|
protected |
Set whether or not the currently authenticated user has enabled their user flair to be displayed on this subreddit
bool | $userSrFlairEnabled |
|
protected |
Set whether or not the currently authenticated user has enabled this subreddit's custom CSS ("community theme")
bool | $userSrThemeEnabled |
|
protected |
Set the number of video streaming links in this subreddit (?) This seems to max out at 100.
int | $videostreamLinksCount |
|
protected |
Set the advertising whitelist status for this subreddit, if set. This indicates which types of ads are eligible to be displayed.
string | $whitelistStatus |
|
protected |
Set whether or not the currently authenticated user has access to edit some or all of this subreddit's wiki.
bool | $wikiEnabled |
|
protected |
Set the numeric whitelist status key, if any
int | $wls |
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.