PHP Класс Maknz\Slack\Attachment

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

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

Свойство Тип Описание
$actions array A maximum of 5 actions may be provided.
$author_icon string Optional author icon for the attachment.
$author_link string Optional author link for the attachment.
$author_name string Optional author name for the attachment.
$color string The color to use for the attachment.
$fallback string The fallback text to use for clients that don't support attachments.
$fields array The fields of the attachment.
$footer string The text to use for the attachment footer.
$footer_icon string The icon to use for the attachment footer.
$image_url string Optional image that should appear within the attachment.
$markdown_fields array The fields of the attachment that Slack should interpret with its Markdown-like language.
$pretext string Optional text that should appear above the formatted data.
$text string Optional text that should appear within the attachment.
$thumb_url string Optional thumbnail that should appear within the attachment.
$timestamp DateTime The timestamp to use for the attachment.
$title string Optional title for the attachment.
$title_link string Optional title link for the attachment.

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

Метод Описание
__construct ( array $attributes ) : void Instantiate a new Attachment.
addAction ( mixed $action ) Add an action to the attachment.
addField ( mixed $field ) Add a field to the attachment.
clearActions ( ) Clear the actions for the attachment.
clearFields ( ) Clear the fields for the attachment.
getActions ( ) : AttachmentAction[] Get the collection of actions (buttons) to include in the attachment.
getAuthorIcon ( ) : string Get the author icon to use for the attachment.
getAuthorLink ( ) : string Get the author link to use for the attachment.
getAuthorName ( ) : string Get the author name to use for the attachment.
getColor ( ) : string Get the color to use for the attachment.
getFallback ( ) : string Get the fallback text.
getFields ( ) : array Get the fields for the attachment.
getFooter ( ) : string Get the footer to use for the attachment.
getFooterIcon ( ) : string Get the footer icon to use for the attachment.
getImageUrl ( ) : string Get the optional image to appear within the attachment.
getMarkdownFields ( ) : array Get the fields Slack should interpret in its Markdown-like language.
getPretext ( ) : string Get the text that should appear above the formatted data.
getText ( ) : string Get the optional text to appear within the attachment.
getThumbUrl ( ) : string Get the optional thumbnail to appear within the attachment.
getTimestamp ( ) : DateTime Get the timestamp to use for the attachment.
getTitle ( ) : string Get the title to use for the attachment.
getTitleLink ( ) : string Get the title link to use for the attachment.
setActions ( array $actions ) : Attachment Set the collection of actions (buttons) to include in the attachment.
setAuthorIcon ( string $author_icon ) Set the author icon to use for the attachment.
setAuthorLink ( string $author_link ) Set the auhtor link to use for the attachment.
setAuthorName ( string $author_name ) Set the author name to use for the attachment.
setColor ( string $color ) Set the color to use for the attachment.
setFallback ( string $fallback ) Set the fallback text.
setFields ( array $fields ) Set the fields for the attachment.
setFooter ( string $footer ) Set the footer text to use for the attachment.
setFooterIcon ( string $footerIcon ) Set the footer icon to use for the attachment.
setImageUrl ( string $image_url ) Set the optional image to appear within the attachment.
setMarkdownFields ( array $fields ) Set the fields Slack should interpret in its Markdown-like language.
setPretext ( string $pretext ) Set the text that should appear above the formatted data.
setText ( string $text ) Set the optional text to appear within the attachment.
setThumbUrl ( string $thumb_url ) Set the optional thumbnail to appear within the attachment.
setTimestamp ( DateTime $timestamp ) Set the timestamp to use for the attachment.
setTitle ( string $title ) Set the title to use for the attachment.
setTitleLink ( string $title_link ) Set the title link to use for the attachment.
toArray ( ) : array Convert this attachment to its array representation.

Защищенные методы

Метод Описание
getActionsAsArrays ( ) : array Iterates over all actions in this attachment and returns them in their array form.
getFieldsAsArrays ( ) : array Iterates over all fields in this attachment and returns them in their array form.

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

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

Instantiate a new Attachment.
public __construct ( array $attributes ) : void
$attributes array
Результат void

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

Add an action to the attachment.
public addAction ( mixed $action )
$action mixed

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

Add a field to the attachment.
public addField ( mixed $field )
$field mixed

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

Clear the actions for the attachment.
public clearActions ( )

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

Clear the fields for the attachment.
public clearFields ( )

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

Get the collection of actions (buttons) to include in the attachment.
public getActions ( ) : AttachmentAction[]
Результат AttachmentAction[]

getActionsAsArrays() защищенный Метод

Iterates over all actions in this attachment and returns them in their array form.
protected getActionsAsArrays ( ) : array
Результат array

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

Get the author icon to use for the attachment.
public getAuthorIcon ( ) : string
Результат string

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

Get the author name to use for the attachment.
public getAuthorName ( ) : string
Результат string

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

Get the color to use for the attachment.
public getColor ( ) : string
Результат string

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

Get the fallback text.
public getFallback ( ) : string
Результат string

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

Get the fields for the attachment.
public getFields ( ) : array
Результат array

getFieldsAsArrays() защищенный Метод

Iterates over all fields in this attachment and returns them in their array form.
protected getFieldsAsArrays ( ) : array
Результат array

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

Get the footer to use for the attachment.
public getFooter ( ) : string
Результат string

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

Get the footer icon to use for the attachment.
public getFooterIcon ( ) : string
Результат string

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

Get the optional image to appear within the attachment.
public getImageUrl ( ) : string
Результат string

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

Get the fields Slack should interpret in its Markdown-like language.
public getMarkdownFields ( ) : array
Результат array

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

Get the text that should appear above the formatted data.
public getPretext ( ) : string
Результат string

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

Get the optional text to appear within the attachment.
public getText ( ) : string
Результат string

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

Get the optional thumbnail to appear within the attachment.
public getThumbUrl ( ) : string
Результат string

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

Get the timestamp to use for the attachment.
public getTimestamp ( ) : DateTime
Результат DateTime

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

Get the title to use for the attachment.
public getTitle ( ) : string
Результат string

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

Set the collection of actions (buttons) to include in the attachment.
public setActions ( array $actions ) : Attachment
$actions array
Результат Attachment

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

Set the author icon to use for the attachment.
public setAuthorIcon ( string $author_icon )
$author_icon string

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

Set the author name to use for the attachment.
public setAuthorName ( string $author_name )
$author_name string

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

Set the color to use for the attachment.
public setColor ( string $color )
$color string

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

Set the fallback text.
public setFallback ( string $fallback )
$fallback string

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

Set the fields for the attachment.
public setFields ( array $fields )
$fields array

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

Set the footer text to use for the attachment.
public setFooter ( string $footer )
$footer string

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

Set the footer icon to use for the attachment.
public setFooterIcon ( string $footerIcon )
$footerIcon string

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

Set the optional image to appear within the attachment.
public setImageUrl ( string $image_url )
$image_url string

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

Set the fields Slack should interpret in its Markdown-like language.
public setMarkdownFields ( array $fields )
$fields array

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

Set the text that should appear above the formatted data.
public setPretext ( string $pretext )
$pretext string

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

Set the optional text to appear within the attachment.
public setText ( string $text )
$text string

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

Set the optional thumbnail to appear within the attachment.
public setThumbUrl ( string $thumb_url )
$thumb_url string

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

Set the timestamp to use for the attachment.
public setTimestamp ( DateTime $timestamp )
$timestamp DateTime

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

Set the title to use for the attachment.
public setTitle ( string $title )
$title string

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

Convert this attachment to its array representation.
public toArray ( ) : array
Результат array

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

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

A maximum of 5 actions may be provided.
protected array $actions
Результат array

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

Optional author icon for the attachment.
protected string $author_icon
Результат string

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

Optional author name for the attachment.
protected string $author_name
Результат string

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

The color to use for the attachment.
protected string $color
Результат string

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

The fallback text to use for clients that don't support attachments.
protected string $fallback
Результат string

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

The fields of the attachment.
protected array $fields
Результат array

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

Optional image that should appear within the attachment.
protected string $image_url
Результат string

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

The fields of the attachment that Slack should interpret with its Markdown-like language.
protected array $markdown_fields
Результат array

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

Optional text that should appear above the formatted data.
protected string $pretext
Результат string

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

Optional text that should appear within the attachment.
protected string $text
Результат string

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

Optional thumbnail that should appear within the attachment.
protected string $thumb_url
Результат string

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

The timestamp to use for the attachment.
protected DateTime $timestamp
Результат DateTime

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

Optional title for the attachment.
protected string $title
Результат string