Menu

## ImageComponentBuilder
in package
implements ComponentBuilder

ImageComponentBuilder.php : 40

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

#### $actionBuilder

ImageComponentBuilder.php : 61
`private TemplateActionBuilder $actionBuilder`

#### $align

ImageComponentBuilder.php : 49
`private ComponentAlign $align`

#### $animated

ImageComponentBuilder.php : 63
`private bool $animated`

#### $aspectMode

ImageComponentBuilder.php : 57
`private ComponentImageAspectMode $aspectMode`

#### $aspectRatio

ImageComponentBuilder.php : 55
`private ComponentImageAspectRatio $aspectRatio`

#### $backgroundColor

ImageComponentBuilder.php : 59
`private string $backgroundColor`

#### $component

ImageComponentBuilder.php : 77
`private array<string|int, mixed>|null $component`

#### $flex

ImageComponentBuilder.php : 45
`private int $flex`

#### $gravity

ImageComponentBuilder.php : 51
`private ComponentGravity $gravity`

#### $margin

ImageComponentBuilder.php : 47
`private ComponentMargin $margin`

#### $offsetBottom

ImageComponentBuilder.php : 70
`private string $offsetBottom`

#### $offsetEnd

ImageComponentBuilder.php : 74
`private string $offsetEnd`

#### $offsetStart

ImageComponentBuilder.php : 72
`private string $offsetStart`

#### $offsetTop

ImageComponentBuilder.php : 68
`private string $offsetTop`

#### $position

ImageComponentBuilder.php : 66
`private string $position`

#### $size

ImageComponentBuilder.php : 53
`private ComponentImageSize $size`

#### $url

ImageComponentBuilder.php : 43
`private string $url`

### Methods

#### __construct()

ImageComponentBuilder.php : 93

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()

ImageComponentBuilder.php : 359

Builds image component structure.

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

##### Return values

array<string|int, mixed> —

#### builder()

ImageComponentBuilder.php : 122

Create empty ImageComponentBuilder.

`public static builder() : ImageComponentBuilder`

##### Return values

ImageComponentBuilder —

#### setAction()

ImageComponentBuilder.php : 247

Set action.

`public setAction(TemplateActionBuilder|null $actionBuilder) : ImageComponentBuilder`

##### Parameters

$actionBuilder : TemplateActionBuilder|null

##### Return values

ImageComponentBuilder —

#### setAlign()

ImageComponentBuilder.php : 169

Set align.

`public setAlign(ComponentAlign|string|null $align) : ImageComponentBuilder`

##### Parameters

$align : ComponentAlign|string|null

##### Return values

ImageComponentBuilder —

#### setAnimated()

ImageComponentBuilder.php : 348

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 —

#### setAspectMode()

ImageComponentBuilder.php : 223

Set aspectMode.

`public setAspectMode(ComponentImageAspectMode|string|null $aspectMode) : ImageComponentBuilder`

##### Parameters

$aspectMode : ComponentImageAspectMode|string|null

##### Return values

ImageComponentBuilder —

#### setAspectRatio()

ImageComponentBuilder.php : 211

Set aspectRatio.

`public setAspectRatio(ComponentImageAspectRatio|string|null $aspectRatio) : ImageComponentBuilder`

##### Parameters

$aspectRatio : ComponentImageAspectRatio|string|null

##### Return values

ImageComponentBuilder —

#### setBackgroundColor()

ImageComponentBuilder.php : 235

Set backgroundColor.

`public setBackgroundColor(string|null $backgroundColor) : ImageComponentBuilder`

##### Parameters

$backgroundColor : string|null

##### Return values

ImageComponentBuilder —

#### setFlex()

ImageComponentBuilder.php : 145

Set flex.

`public setFlex(int|null $flex) : ImageComponentBuilder`

##### Parameters

$flex : int|null

##### Return values

ImageComponentBuilder —

#### setGravity()

ImageComponentBuilder.php : 181

Set gravity.

`public setGravity(ComponentGravity|string|null $gravity) : ImageComponentBuilder`

##### Parameters

$gravity : ComponentGravity|string|null

##### Return values

ImageComponentBuilder —

#### setMargin()

ImageComponentBuilder.php : 157

Set margin.

`public setMargin(ComponentMargin|string|null $margin) : ImageComponentBuilder`

##### Parameters

$margin : ComponentMargin|string|null

##### Return values

ImageComponentBuilder —

#### setOffsetBottom()

ImageComponentBuilder.php : 297

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()

ImageComponentBuilder.php : 333

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()

ImageComponentBuilder.php : 315

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()

ImageComponentBuilder.php : 279

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 —

#### setPosition()

ImageComponentBuilder.php : 261

Set position.

`public setPosition(string|ComponentPosition|null $position) : $this`

specifiable relative or absolute

##### Parameters

$position : string|ComponentPosition|null

##### Return values

$this —

#### setSize()

ImageComponentBuilder.php : 199

Set size.

`public setSize(ComponentImageSize|string|null $size) : ImageComponentBuilder`

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

##### Parameters

$size : ComponentImageSize|string|null

##### Return values

ImageComponentBuilder —

#### setUrl()

ImageComponentBuilder.php : 133

Set url.

`public setUrl(string $url) : ImageComponentBuilder`

##### Parameters

$url : string

##### Return values

ImageComponentBuilder —

## Search results