PHP 클래스 Maknz\Slack\Attachment

파일 보기 프로젝트 열기: maknz/slack 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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