PHP Class Maknz\Slack\Attachment

Afficher le fichier Open project: maknz/slack Class Usage Examples

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

Instantiate a new Attachment.
public __construct ( array $attributes ) : void
$attributes array
Résultat void

addAction() public méthode

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

addField() public méthode

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

clearActions() public méthode

Clear the actions for the attachment.
public clearActions ( )

clearFields() public méthode

Clear the fields for the attachment.
public clearFields ( )

getActions() public méthode

Get the collection of actions (buttons) to include in the attachment.
public getActions ( ) : AttachmentAction[]
Résultat AttachmentAction[]

getActionsAsArrays() protected méthode

Iterates over all actions in this attachment and returns them in their array form.
protected getActionsAsArrays ( ) : array
Résultat array

getAuthorIcon() public méthode

Get the author icon to use for the attachment.
public getAuthorIcon ( ) : string
Résultat string

getAuthorName() public méthode

Get the author name to use for the attachment.
public getAuthorName ( ) : string
Résultat string

getColor() public méthode

Get the color to use for the attachment.
public getColor ( ) : string
Résultat string

getFallback() public méthode

Get the fallback text.
public getFallback ( ) : string
Résultat string

getFields() public méthode

Get the fields for the attachment.
public getFields ( ) : array
Résultat array

getFieldsAsArrays() protected méthode

Iterates over all fields in this attachment and returns them in their array form.
protected getFieldsAsArrays ( ) : array
Résultat array

getFooter() public méthode

Get the footer to use for the attachment.
public getFooter ( ) : string
Résultat string

getFooterIcon() public méthode

Get the footer icon to use for the attachment.
public getFooterIcon ( ) : string
Résultat string

getImageUrl() public méthode

Get the optional image to appear within the attachment.
public getImageUrl ( ) : string
Résultat string

getMarkdownFields() public méthode

Get the fields Slack should interpret in its Markdown-like language.
public getMarkdownFields ( ) : array
Résultat array

getPretext() public méthode

Get the text that should appear above the formatted data.
public getPretext ( ) : string
Résultat string

getText() public méthode

Get the optional text to appear within the attachment.
public getText ( ) : string
Résultat string

getThumbUrl() public méthode

Get the optional thumbnail to appear within the attachment.
public getThumbUrl ( ) : string
Résultat string

getTimestamp() public méthode

Get the timestamp to use for the attachment.
public getTimestamp ( ) : DateTime
Résultat DateTime

getTitle() public méthode

Get the title to use for the attachment.
public getTitle ( ) : string
Résultat string

setActions() public méthode

Set the collection of actions (buttons) to include in the attachment.
public setActions ( array $actions ) : Attachment
$actions array
Résultat Attachment

setAuthorIcon() public méthode

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

setAuthorName() public méthode

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

setColor() public méthode

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

setFallback() public méthode

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

setFields() public méthode

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

setFooter() public méthode

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

setFooterIcon() public méthode

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

setImageUrl() public méthode

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

setMarkdownFields() public méthode

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

setPretext() public méthode

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

setText() public méthode

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

setThumbUrl() public méthode

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

setTimestamp() public méthode

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

setTitle() public méthode

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

toArray() public méthode

Convert this attachment to its array representation.
public toArray ( ) : array
Résultat array

Property Details

$actions protected_oe property

A maximum of 5 actions may be provided.
protected array $actions
Résultat array

$author_icon protected_oe property

Optional author icon for the attachment.
protected string $author_icon
Résultat string

$author_name protected_oe property

Optional author name for the attachment.
protected string $author_name
Résultat string

$color protected_oe property

The color to use for the attachment.
protected string $color
Résultat string

$fallback protected_oe property

The fallback text to use for clients that don't support attachments.
protected string $fallback
Résultat string

$fields protected_oe property

The fields of the attachment.
protected array $fields
Résultat array

$image_url protected_oe property

Optional image that should appear within the attachment.
protected string $image_url
Résultat string

$markdown_fields protected_oe property

The fields of the attachment that Slack should interpret with its Markdown-like language.
protected array $markdown_fields
Résultat array

$pretext protected_oe property

Optional text that should appear above the formatted data.
protected string $pretext
Résultat string

$text protected_oe property

Optional text that should appear within the attachment.
protected string $text
Résultat string

$thumb_url protected_oe property

Optional thumbnail that should appear within the attachment.
protected string $thumb_url
Résultat string

$timestamp protected_oe property

The timestamp to use for the attachment.
protected DateTime $timestamp
Résultat DateTime

$title protected_oe property

Optional title for the attachment.
protected string $title
Résultat string