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

Public Member Functions

 getCommentKarma ()
 
 getHasSubscribed ()
 
 getHasVerifiedEmail ()
 
 getHideFromRobots ()
 
 getIconImg ()
 
 getIsEmployee ()
 
 getIsGold ()
 
 getIsMod ()
 
 getLinkKarma ()
 
 getName ()
 
 getPrefShowSnoovatar ()
 
 getSubreddit ()
 
 getVerified ()
 
- 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_\-]{3,20}$|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

 setCommentKarma (int $commentKarma)
 
 setHasSubscribed (bool $hasSubscribed)
 
 setHasVerifiedEmail (bool $hasVerifiedEmail)
 
 setHideFromRobots (bool $hideFromRobots)
 
 setIconImg (string $iconImg)
 
 setIsEmployee (bool $isEmployee)
 
 setIsGold (bool $isGold)
 
 setIsMod (bool $isMod)
 
 setLinkKarma (int $linkKarma)
 
 setName (string $name)
 
 setPrefShowSnoovatar (bool $prefShowSnoovatar)
 
 setSubreddit (array $subreddit=null)
 
 setVerified (bool $verified)
 
- 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

 $id = null
 
 $commentKarma = 0
 
 $hasSubscribed = true
 
 $hasVerifiedEmail = false
 
 $hideFromRobots = false
 
 $iconImg = ''
 
 $isEmployee = false
 
 $isGold = false
 
 $isMod = false
 
 $linkKarma = 1
 
 $name = ''
 
 $prefShowSnoovatar = false
 
 $subreddit = null
 
 $verified = false
 
- 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 Account class represents the common properties exposed for any Reddit user account. You can't instantiate an Account; instead, you should create a MyAccount or a UserAccount, depending on the API request type.

Implementation warning: The $subreddit array is currently populated as-is, without any further processing. Calling getSubreddit() will return an array of key/value pairs defining the user's /u/username profile subreddit, or null if one doesn't exist. This is subject to change in a future major version, such that a Subreddit object 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.

Member Function Documentation

◆ getCommentKarma()

snuze\Reddit\Thing\Account\Account::getCommentKarma ( )

Get this account's comment karma score

Returns
int

◆ getHasSubscribed()

snuze\Reddit\Thing\Account\Account::getHasSubscribed ( )

Unknown

Returns
bool
Todo:
verify what exactly this corresponds to

◆ getHasVerifiedEmail()

snuze\Reddit\Thing\Account\Account::getHasVerifiedEmail ( )

Get whether or not this account has a verified email address

Returns
bool

◆ getHideFromRobots()

snuze\Reddit\Thing\Account\Account::getHideFromRobots ( )

Get whether or not this account has enabled the "don't allow search engines to index my user profile" preference

Returns
bool

◆ getIconImg()

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

Get the full URI to this account's avatar image

Returns
string

◆ getIsEmployee()

snuze\Reddit\Thing\Account\Account::getIsEmployee ( )

Get whether or not this account belongs to a Reddit administrator

Returns
bool

◆ getIsGold()

snuze\Reddit\Thing\Account\Account::getIsGold ( )

Get whether or not this account has Reddit Gold

Returns
bool

◆ getIsMod()

snuze\Reddit\Thing\Account\Account::getIsMod ( )

Get whether or not this account is a moderator of any subreddits

Returns
bool

◆ getLinkKarma()

snuze\Reddit\Thing\Account\Account::getLinkKarma ( )

Get this account's link karma score

Returns
int

◆ getName()

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

Get this account's username

Returns
string

◆ getPrefShowSnoovatar()

snuze\Reddit\Thing\Account\Account::getPrefShowSnoovatar ( )

Get whether or not this account has enabled the "make my snoovatar public" preference

Returns
bool

◆ getSubreddit()

snuze\Reddit\Thing\Account\Account::getSubreddit ( )

Get an array of key/value pairs defining this account's /u/username profile subreddit if one exists, or null otherwise

Returns
array|null

◆ getVerified()

snuze\Reddit\Thing\Account\Account::getVerified ( )

Unknown (always true?)

Returns
bool
Todo:
verify what exactly this corresponds to

◆ setCommentKarma()

snuze\Reddit\Thing\Account\Account::setCommentKarma ( int  $commentKarma)
protected

Set this account's comment karma score

Parameters
int$commentKarma
Returns
$this

◆ setHasSubscribed()

snuze\Reddit\Thing\Account\Account::setHasSubscribed ( bool  $hasSubscribed)
protected

Unknown

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

◆ setHasVerifiedEmail()

snuze\Reddit\Thing\Account\Account::setHasVerifiedEmail ( bool  $hasVerifiedEmail)
protected

Set whether or not this account has a verified email address

Parameters
bool$hasVerifiedEmail
Returns
$this

◆ setHideFromRobots()

snuze\Reddit\Thing\Account\Account::setHideFromRobots ( bool  $hideFromRobots)
protected

Set whether or not this account has enabled the "don't allow search engines to index my user profile" preference

Parameters
bool$hideFromRobots
Returns
$this

◆ setIconImg()

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

Set the full URI to this account's avatar image

Parameters
string$iconImg
Returns
$this

◆ setIsEmployee()

snuze\Reddit\Thing\Account\Account::setIsEmployee ( bool  $isEmployee)
protected

Set whether or not this account belongs to a Reddit administrator

Parameters
bool$isEmployee
Returns
$this

◆ setIsGold()

snuze\Reddit\Thing\Account\Account::setIsGold ( bool  $isGold)
protected

Set whether or not this account has Reddit Gold

Parameters
bool$isGold
Returns
$this

◆ setIsMod()

snuze\Reddit\Thing\Account\Account::setIsMod ( bool  $isMod)
protected

Set whether or not this account is a moderator of any subreddits

Parameters
bool$isMod
Returns
$this

◆ setLinkKarma()

snuze\Reddit\Thing\Account\Account::setLinkKarma ( int  $linkKarma)
protected

Set this account's link karma score

Parameters
int$linkKarma
Returns
$this

◆ setName()

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

Set this account's username

Parameters
string$name
Returns
$this
Exceptions

◆ setPrefShowSnoovatar()

snuze\Reddit\Thing\Account\Account::setPrefShowSnoovatar ( bool  $prefShowSnoovatar)
protected

Set whether or not this account has enabled the "make my snoovatar public" preference

Parameters
bool$prefShowSnoovatar
Returns
$this

◆ setSubreddit()

snuze\Reddit\Thing\Account\Account::setSubreddit ( array  $subreddit = null)
protected

Set an array of key/value pairs defining this account's /u/username profile subreddit if one exists, or null otherwise

Parameters
array$subreddit
Returns
$this

◆ setVerified()

snuze\Reddit\Thing\Account\Account::setVerified ( bool  $verified)
protected

Unknown (always true?)

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

Member Data Documentation

◆ REGEX_VALID_NAME

const snuze\Reddit\Thing\Account\Account::REGEX_VALID_NAME = '|^[a-z0-9_\-]{3,20}$|i'

A regular expression used to test whether or not an account username is valid. Usernames must be between 3 and 20 characters long and may contain only alphanumerics, hyphens, and underscores.


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