Bitrix API

Block extends BaseTable

Table of Contents

Properties

$internalClass  : string
Internal class.

Methods

add()  : AddResult
Creates new record and return it new result.
callback()  : void
Registers calllback for internal table.
checkBeforeSave()  : Result
Must return false, if block data is not correct for saving.
delete()  : Result
Deletes exists record.
getBlank()  : Blank|null
Returns block's Blank.
getByCode()  : self|null
Returns block instance by code.
getCode()  : string
Returns block's code.
getData()  : array<string|int, mixed>
Returns block class' form manifest.
getDocument()  : Document
getHint()  : string
Returns block's hint.
getId()  : int|null
Returns id of the block.
getList()  : Result
Returns records of table.
getMap()  : array<string|int, mixed>
Returns table's map.
getPart()  : int|null
Returns member part of this block.
getPosition()  : array<string|int, mixed>|null
Returns position of the block.
getRepository()  : array<string|int, Block>
Returns repository of blocks.
getSection()  : string
Returns block's section.
getSections()  : array<string|int, mixed>
Returns sections as pairs of code and title.
getStyle()  : array<string|int, mixed>|null
Returns style of the block.
getTitle()  : string
Returns block's title.
getViewData()  : array<string|int, mixed>
Returns block class' view data
isEmpty()  : bool
Returns true, if block is empty (no data).
isThirdParty()  : bool
Returns true if block for third party only.
remove()  : bool
Removes current block.
setBlank()  : void
Sets blank, within which this block.
setData()  : bool
Updates entity data.
setDocument()  : void
Sets document, within which this block now.
setId()  : void
Sets id to the block.
setMemberPart()  : void
Sets member part to the block.
setPayload()  : void
Sets data to the block.
setPosition()  : void
Sets position to the block.
setStyle()  : void
Sets style to the block.
update()  : Result
Updates exists record.
wasUpdatedOnBlank()  : void
Calls when block success added or updated on blank.

Properties

$internalClass

Internal class.

public static string $internalClass = 'BlockTable'

Methods

add()

Creates new record and return it new result.

public static add(array<string|int, mixed> $fields) : AddResult
Parameters
$fields : array<string|int, mixed>

Fields array.

Return values
AddResult

callback()

Registers calllback for internal table.

public static callback(string $code, callable $callback) : void
Parameters
$code : string

Type of callback.

$callback : callable

Callback.

checkBeforeSave()

Must return false, if block data is not correct for saving.

public checkBeforeSave() : Result
Return values
Result

delete()

Deletes exists record.

public static delete(int $id) : Result
Parameters
$id : int

Record key.

Return values
Result

getBlank()

Returns block's Blank.

public getBlank() : Blank|null
Return values
Blank|null

getByCode()

Returns block instance by code.

public static getByCode(string $code) : self|null
Parameters
$code : string

Block code.

Return values
self|null

getCode()

Returns block's code.

public getCode() : string
Return values
string

getData()

Returns block class' form manifest.

public getData([bool $externalProcessing = true ]) : array<string|int, mixed>
Parameters
$externalProcessing : bool = true

Before send data prepare by external block classes (true by default).

Return values
array<string|int, mixed>

getDocument()

public getDocument() : Document
Return values
Document

getHint()

Returns block's hint.

public getHint() : string
Return values
string

getId()

Returns id of the block.

public getId() : int|null
Return values
int|null

getList()

Returns records of table.

public static getList([array<string|int, mixed> $params = [] ]) : Result
Parameters
$params : array<string|int, mixed> = []

Params array like ORM style.

Return values
Result

getMap()

Returns table's map.

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

getPart()

Returns member part of this block.

public getPart() : int|null
Return values
int|null

getPosition()

Returns position of the block.

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

getRepository()

Returns repository of blocks.

public static getRepository() : array<string|int, Block>
Return values
array<string|int, Block>

getSection()

Returns block's section.

public getSection() : string
Return values
string

getSections()

Returns sections as pairs of code and title.

public static getSections() : array<string|int, mixed>
Tags
@return

array<, <title>>

Return values
array<string|int, mixed>

getStyle()

Returns style of the block.

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

getTitle()

Returns block's title.

public getTitle() : string
Return values
string

getViewData()

Returns block class' view data

public getViewData([bool $externalProcessing = true ]) : array<string|int, mixed>
Parameters
$externalProcessing : bool = true

Before send data prepare by external block classes (true by default).

Return values
array<string|int, mixed>

isEmpty()

Returns true, if block is empty (no data).

public isEmpty() : bool
Return values
bool

isThirdParty()

Returns true if block for third party only.

public isThirdParty() : bool
Return values
bool

remove()

Removes current block.

public remove() : bool
Return values
bool

setBlank()

Sets blank, within which this block.

public setBlank(Blank $blank) : void
Parameters
$blank : Blank

Blank instance.

setData()

Updates entity data.

public setData(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>

New blank data.

Return values
bool

setDocument()

Sets document, within which this block now.

public setDocument(Document|null $document) : void
Parameters
$document : Document|null

Document instance.

setId()

Sets id to the block.

public setId(int $id) : void
Parameters
$id : int

Id.

setMemberPart()

Sets member part to the block.

public setMemberPart(int $part) : void
Parameters
$part : int

Member part.

setPayload()

Sets data to the block.

public setPayload(array<string|int, mixed>|null $data) : void
Parameters
$data : array<string|int, mixed>|null

Block data.

setPosition()

Sets position to the block.

public setPosition(array<string|int, mixed>|null $position) : void
Parameters
$position : array<string|int, mixed>|null

Position data (top / left / bottom / width / height / widthPx / heightPx / page).

setStyle()

Sets style to the block.

public setStyle(array<string|int, mixed>|null $style) : void
Parameters
$style : array<string|int, mixed>|null

Style data (cssProperty => cssPropertyValue).

update()

Updates exists record.

public static update(int $id[, array<string|int, mixed> $fields = [] ]) : Result
Parameters
$id : int

Record key.

$fields : array<string|int, mixed> = []

Fields array.

Return values
Result

wasUpdatedOnBlank()

Calls when block success added or updated on blank.

public wasUpdatedOnBlank() : void

        
On this page

Search results