LINE Messaging API SDK for PHP

ImageComponentBuilder implements ComponentBuilder

A builder class for image component.

Tags
SuppressWarnings

(PHPMD.ExcessiveParameterList)

Interfaces, Classes and Traits

ComponentBuilder
The interface that has a responsibility to build component.

Table of Contents

$actionBuilder  : TemplateActionBuilder
$align  : ComponentAlign
$animated  : bool
$aspectMode  : ComponentImageAspectMode
$aspectRatio  : ComponentImageAspectRatio
$backgroundColor  : string
$component  : array<string|int, mixed>|null
$flex  : int
$gravity  : ComponentGravity
$margin  : ComponentMargin
$offsetBottom  : string
$offsetEnd  : string
$offsetStart  : string
$offsetTop  : string
$position  : string
$size  : ComponentImageSize
$url  : string
__construct()  : mixed
ImageComponentBuilder constructor.
build()  : array<string|int, mixed>
Builds image component structure.
builder()  : ImageComponentBuilder
Create empty ImageComponentBuilder.
setAction()  : ImageComponentBuilder
Set action.
setAlign()  : ImageComponentBuilder
Set align.
setAnimated()  : $this
Set animated.
setAspectMode()  : ImageComponentBuilder
Set aspectMode.
setAspectRatio()  : ImageComponentBuilder
Set aspectRatio.
setBackgroundColor()  : ImageComponentBuilder
Set backgroundColor.
setFlex()  : ImageComponentBuilder
Set flex.
setGravity()  : ImageComponentBuilder
Set gravity.
setMargin()  : ImageComponentBuilder
Set margin.
setOffsetBottom()  : $this
Set offsetBottom.
setOffsetEnd()  : $this
Set offsetEnd.
setOffsetStart()  : $this
Set offsetStart.
setOffsetTop()  : $this
Set offsetTop.
setPosition()  : $this
Set position.
setSize()  : ImageComponentBuilder
Set size.
setUrl()  : ImageComponentBuilder
Set url.

Properties

Methods

__construct()

ImageComponentBuilder constructor.

public __construct(string|null $url[, int|null $flex = null ][, ComponentMargin|null $margin = null ][, ComponentAlign|null $align = null ][, ComponentGravity|null $gravity = null ][, ComponentImageSize|string|null $size = null ][, ComponentImageAspectRatio|null $aspectRatio = null ][, ComponentImageAspectMode|null $aspectMode = null ][, string|null $backgroundColor = null ][, TemplateActionBuilder|null $actionBuilder = null ]) : mixed
Parameters
$url : string|null
$flex : int|null = null
$margin : ComponentMargin|null = null
$align : ComponentAlign|null = null
$gravity : ComponentGravity|null = null
$size : ComponentImageSize|string|null = null
$aspectRatio : ComponentImageAspectRatio|null = null
$aspectMode : ComponentImageAspectMode|null = null
$backgroundColor : string|null = null
$actionBuilder : TemplateActionBuilder|null = null
Return values
mixed

build()

Builds image component structure.

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

setAnimated()

Set animated.

public setAnimated([bool $animated = false ]) : $this

When this is true, an animated image (APNG) plays. default: false

Parameters
$animated : bool = false
Return values
$this

setOffsetBottom()

Set offsetBottom.

public setOffsetBottom(string|ComponentSpacing|null $offsetBottom) : $this

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

Parameters
$offsetBottom : string|ComponentSpacing|null
Return values
$this

setOffsetEnd()

Set offsetEnd.

public setOffsetEnd(string|ComponentSpacing|null $offsetEnd) : $this

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

Parameters
$offsetEnd : string|ComponentSpacing|null
Return values
$this

setOffsetStart()

Set offsetStart.

public setOffsetStart(string|ComponentSpacing|null $offsetStart) : $this

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

Parameters
$offsetStart : string|ComponentSpacing|null
Return values
$this

setOffsetTop()

Set offsetTop.

public setOffsetTop(string|ComponentSpacing|null $offsetTop) : $this

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

Parameters
$offsetTop : string|ComponentSpacing|null
Return values
$this

Search results