Documentation

SocialMedia extends Base
in package

Class SocialMedia.

Table of Contents

ALLOWED_UITYPE  = [313 => 'twitter']
Array of allowed uiType.
$type  : string
Configuration type.
$value  : mixed
__construct()  : mixed
SocialMedia constructor.
clearCache()  : mixed
Function clears cache.
createObjectByUiType()  : Base|bool
Create object by uitype.
get()  : mixed
Function to get the value for a given key.
getArray()  : array<string|int, mixed>
Function to get the array values for a given key.
getClassNameByUiType()  : string
Get class name.
getData()  : array<string|int, mixed>
Function to get all the values of the Object.
getForHtml()  : mixed
Function to get the html encoded value for a given key.
getForSql()  : mixed
Function to get the value if its safe to use for SQL Query (column).
getInstance()  : SocialMedia
Return object instance.
getKeys()  : array<string|int, string>
Function to get keys.
getLogs()  : Generator
Get logs from db.
getSocialMediaAccount()  : Base|Generator|void
Get all social media accounts.
getUitypeFromParam()  : array<string|int, int>
has()  : bool
Function to check if the key exists.
isActiveByType()  : bool
Check if it is configured social media by uitype.
isEmpty()  : bool
Function to check if the key is empty.
isEnableForModule()  : bool
Checking whether social media are available for the module.
log()  : mixed
remove()  : mixed
Function to remove the value.
removeAccount()  : mixed
Remove a social account from the database if not used.
removeMass()  : mixed
Remove mass social media records from the database if not used.
save()  : mixed
Save changes to DB.
set()  : $this
Function to set the value for a given key.
setData()  : $this
Function to set all the values.
getSocialMediaQuery()  : Query|false
Get social media query.

Constants

ALLOWED_UITYPE

Array of allowed uiType.

public mixed ALLOWED_UITYPE = [313 => 'twitter']

Properties

$value

protected mixed $value

Methods

__construct()

SocialMedia constructor.

public __construct(string $type) : mixed
Parameters
$type : string

Type of config

Return values
mixed

clearCache()

Function clears cache.

public clearCache() : mixed
Return values
mixed

createObjectByUiType()

Create object by uitype.

public static createObjectByUiType(int $uiType, string $accountName) : Base|bool
Parameters
$uiType : int
$accountName : string
Tags
throws
AppException
Return values
Base|bool

get()

Function to get the value for a given key.

public get(string $key) : mixed
Parameters
$key : string
Return values
mixed

Value for the given key

getArray()

Function to get the array values for a given key.

public getArray(string $key[, array<string|int, mixed> $value = [] ]) : array<string|int, mixed>
Parameters
$key : string
$value : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getClassNameByUiType()

Get class name.

public static getClassNameByUiType(int $uiType) : string
Parameters
$uiType : int
Tags
throws
AppException
Return values
string

getData()

Function to get all the values of the Object.

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getForHtml()

Function to get the html encoded value for a given key.

public getForHtml(string $key) : mixed
Parameters
$key : string
Return values
mixed

getForSql()

Function to get the value if its safe to use for SQL Query (column).

public getForSql(string $key[, bool $skipEmtpy = true ]) : mixed
Parameters
$key : string
$skipEmtpy : bool = true

Skip the check if string is empty

Return values
mixed

Value for the given key

getInstance()

Return object instance.

public static getInstance(string $type) : SocialMedia
Parameters
$type : string

Type of config

Return values
SocialMedia

getKeys()

Function to get keys.

public getKeys() : array<string|int, string>
Return values
array<string|int, string>

getLogs()

Get logs from db.

public static getLogs() : Generator
Return values
Generator

getSocialMediaAccount()

Get all social media accounts.

public static getSocialMediaAccount(string|array<string|int, string> $socialMediaType) : Base|Generator|void
Parameters
$socialMediaType : string|array<string|int, string>
Tags
throws
AppException
Return values
Base|Generator|void

getUitypeFromParam()

public static getUitypeFromParam(string|array<string|int, string> $socialMediaType) : array<string|int, int>
Parameters
$socialMediaType : string|array<string|int, string>
Tags
throws
AppException
Return values
array<string|int, int>

has()

Function to check if the key exists.

public has(string $key) : bool
Parameters
$key : string
Return values
bool

isActiveByType()

Check if it is configured social media by uitype.

public static isActiveByType(int $uiType) : bool
Parameters
$uiType : int
Tags
throws
AppException
Return values
bool

isEmpty()

Function to check if the key is empty.

public isEmpty(string $key) : bool
Parameters
$key : string
Return values
bool

isEnableForModule()

Checking whether social media are available for the module.

public static isEnableForModule(string $moduleName) : bool
Parameters
$moduleName : string

Name of module

Return values
bool

log()

public static log(int $uiType, string $typeOfLog, string $message) : mixed
Parameters
$uiType : int
$typeOfLog : string
$message : string
Tags
throws
AppException
Return values
mixed

remove()

Function to remove the value.

public remove(string $key) : mixed
Parameters
$key : string
Return values
mixed

removeAccount()

Remove a social account from the database if not used.

public static removeAccount(int $uiType, string $accountName) : mixed
Parameters
$uiType : int
$accountName : string
Return values
mixed

removeMass()

Remove mass social media records from the database if not used.

public static removeMass(int $uiType, array<string|int, string> $logins) : mixed
Parameters
$uiType : int
$logins : array<string|int, string>
Tags
throws
AppException
Return values
mixed

save()

Save changes to DB.

public save() : mixed
Tags
throws
Exception
Return values
mixed

set()

Function to set the value for a given key.

public set(string $key, mixed $value) : $this
Parameters
$key : string
$value : mixed
Return values
$this

setData()

Function to set all the values.

public setData(mixed $values) : $this
Parameters
$values : mixed
Return values
$this

getSocialMediaQuery()

Get social media query.

private static getSocialMediaQuery(string|array<string|int, string> $socialMediaType) : Query|false
Parameters
$socialMediaType : string|array<string|int, string>
Tags
throws
AppException
Return values
Query|false

        

Search results