PHP Класс Twitter\Intents\Tweet

С версии: 1.0.0
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$hashtags Hashtags to include in the Tweet
$in_reply_to Parent Tweet identifier
$related May be presented as a suggested account to follow after the Tweet is published
$text Pre-populated Tweet text
$url Share a URL
$validate_inputs Validate passed variables before storing
$via Associate a Tweet with an source Twitter account such as the username of your website

Открытые методы

Метод Описание
addHashtag ( string $hashtag ) : __CLASS__ Add a hashtag
addRelated ( string $username, string $label = '' ) : __CLASS__ Add a related Twitter account
disableValidation ( ) : __CLASS__ Do not validate inputs
enableValidation ( ) : __CLASS__ Validate inputs
fromArray ( array $values ) : __CLASS__ Construct a new Tweet intent object from an options array
getHashtags ( ) : array Get a list of hashtags stored for the Tweet
getIntentURL ( ) : string Tweet intent URL
getRelated ( ) : array Get related Twitter usernames
getVia ( ) : string Get the stored via value
isHTTPURL ( string $url ) : boolean Is the passed URL an absolute URL using the HTTP or HTTPS scheme?
setInReplyTo ( string $tweet_id ) : __CLASS__ Define a parent Tweet by ID
setText ( string $text ) : __CLASS__ Pre-populate Tweet text
setURL ( string $url ) : __CLASS__ Share a URL
setVia ( string $username ) : __CLASS__ Associate Tweet with a source account
shouldValidate ( ) : boolean Should data be validated before setting?
toQueryParameters ( ) : array Convert parameters into an array prepped for use in query parameters (underscores) or data-* attributes (dashed)

Описание методов

addHashtag() публичный Метод

Add a hashtag
С версии: 1.0.0
public addHashtag ( string $hashtag ) : __CLASS__
$hashtag string hashtag
Результат __CLASS__ support chaining

addRelated() публичный Метод

Add a related Twitter account
С версии: 1.0.0
public addRelated ( string $username, string $label = '' ) : __CLASS__
$username string Twitter username
$label string brief description of how the account relates to the Tweet content
Результат __CLASS__ support chaining

disableValidation() публичный Метод

Disabling validation may speed up Web Intent generation but may also cause user-facing issues
С версии: 1.0.0
public disableValidation ( ) : __CLASS__
Результат __CLASS__ support chaining

enableValidation() публичный Метод

Validate inputs
С версии: 1.0.0
public enableValidation ( ) : __CLASS__
Результат __CLASS__ support chaining

fromArray() публичный статический Метод

Construct a new Tweet intent object from an options array
С версии: 1.0.0
public static fromArray ( array $values ) : __CLASS__
$values array options array { @type string option name @type string|int|bool option value }
Результат __CLASS__ object initialized based on passed array values

getHashtags() публичный Метод

Get a list of hashtags stored for the Tweet
С версии: 1.0.0
public getHashtags ( ) : array
Результат array hashtags { @type string hashtag }

getIntentURL() публичный Метод

Tweet intent URL
С версии: 1.0.0
public getIntentURL ( ) : string
Результат string Tweet intent URL with query parameters

getRelated() публичный Метод

Get related Twitter usernames
С версии: 1.0.0
public getRelated ( ) : array
Результат array { @type string username in lowercase @type string description of how the username relates to Tweet content }

getVia() публичный Метод

Get the stored via value
С версии: 1.0.1
public getVia ( ) : string
Результат string source Twitter account username

isHTTPURL() публичный статический Метод

Is the passed URL an absolute URL using the HTTP or HTTPS scheme?
С версии: 1.0.0
public static isHTTPURL ( string $url ) : boolean
$url string URL to test
Результат boolean true if URL was parsed and contains a HTTP or HTTPs scheme

setInReplyTo() публичный Метод

Define a parent Tweet by ID
С версии: 1.0.0
public setInReplyTo ( string $tweet_id ) : __CLASS__
$tweet_id string Parent Tweet ID
Результат __CLASS__ support chaining

setText() публичный Метод

Pre-populate Tweet text
С версии: 1.0.0
public setText ( string $text ) : __CLASS__
$text string Tweet text
Результат __CLASS__ support chaining

setURL() публичный Метод

Share a URL
С версии: 1.0.0
public setURL ( string $url ) : __CLASS__
$url string absolute URL
Результат __CLASS__ support chaining

setVia() публичный Метод

Associate Tweet with a source account
С версии: 1.0.0
public setVia ( string $username ) : __CLASS__
$username string Twitter username
Результат __CLASS__ support chaining

shouldValidate() публичный Метод

Should data be validated before setting?
С версии: 1.0.0
public shouldValidate ( ) : boolean
Результат boolean validate inputs

toQueryParameters() публичный Метод

Convert parameters into an array prepped for use in query parameters (underscores) or data-* attributes (dashed)
С версии: 1.0.0
public toQueryParameters ( ) : array
Результат array Tweet parameters { @type string Tweet parameter @type string parameter value }

Описание свойств

$hashtags защищенное свойство

Hashtags to include in the Tweet
С версии: 1.0.0
protected $hashtags

$in_reply_to защищенное свойство

Parent Tweet identifier
С версии: 1.0.0
protected $in_reply_to

$text защищенное свойство

Pre-populated Tweet text
С версии: 1.0.0
protected $text

$url защищенное свойство

Share a URL
С версии: 1.0.0
protected $url

$validate_inputs защищенное свойство

Validate passed variables before storing
С версии: 1.0.0
protected $validate_inputs

$via защищенное свойство

Associate a Tweet with an source Twitter account such as the username of your website
С версии: 1.0.0
protected $via