class Set extends ConcreteObject (View source)

Properties

$error from ConcreteObject

Methods

loadError($error)

No description

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

static 
camelcase($file)

No description

static 
uncamelcase($string)

No description

static Set|null
getByID(int $btsID)

Get a block type set given its ID.

static Set|null
getByHandle(string $btsHandle)

Get a block type set given its handle.

static Set[]
getListByPackage(Package|Package|int $pkg)

Get the list of block type sets defined by a package.

static Set[]
getList(string[] $excluded = ['core_desktop'])

Get the list of block type sets.

static Set
add(string $btsHandle, string $btsName, Package|Package|int|false $pkg = false)

Create a new block type set.

static 
exportList(SimpleXMLElement $xml)

Export all the block type sets to a SimpleXMLElement element.

static BlockType[]
getUnassignedBlockTypes(bool $includeInternalBlockTypes = false)

Get the list of block types that don't belong to any block type set.

int
getBlockTypeSetID()

Get the block type set ID.

string
getBlockTypeSetHandle()

Get the block type set handle.

string
getBlockTypeSetName()

Get the block type set name.

string
getBlockTypeSetDisplayName(string $format = 'html')

Get the block type set name (localized and escaped accordingly to $format).

int|null
getPackageID()

Get the ID of the package that defined this set.

string|false
getPackageHandle()

Get the handle of the package that defined this set.

updateBlockTypeSetName(string $btsName)

Update the name of this set.

updateBlockTypeSetHandle(string $btsHandle)

Update the handle of this set.

updateBlockTypeSetDisplayOrder(int $displayOrder)

Update the display order of this set.

addBlockType(BlockType $bt)

Associate a block type to this set.

setBlockTypeDisplayOrder(BlockType $bt, int $displayOrder)

Update the display order of a block type contained in this set.

clearBlockTypes()

Disassociate all the block types currently associated to this set.

deleteKey(BlockType|int $bt)

Dissociate a specific block type currently associated to this set.

export(SimpleXMLElement $axml)

Export this set to a SimpleXMLElement element.

getBlockTypes()

Get the list of block types associated to this set.

bool
contains(BlockType|int $bt)

Does this set contain a block type?

int|false
displayOrder(BlockType|int $bt)

Get the display order of a block type as sorted for this set.

delete()

Delete this set.

get() deprecated

No description

rescanDisplayOrder()

Regenereate the display order values of the block types associated to this set.

Details

loadError($error)

Parameters

$error

isError()

getError()

setPropertiesFromArray($arr)

Parameters

$arr

static camelcase($file)

Parameters

$file

static uncamelcase($string)

Parameters

$string

static Set|null getByID(int $btsID)

Get a block type set given its ID.

Parameters

int $btsID

Return Value

Set|null

static Set|null getByHandle(string $btsHandle)

Get a block type set given its handle.

Parameters

string $btsHandle

Return Value

Set|null

static Set[] getListByPackage(Package|Package|int $pkg)

Get the list of block type sets defined by a package.

Parameters

Package|Package|int $pkg

Return Value

Set[]

static Set[] getList(string[] $excluded = ['core_desktop'])

Get the list of block type sets.

Parameters

string[] $excluded a list of block type set handles to be exluded

Return Value

Set[]

static Set add(string $btsHandle, string $btsName, Package|Package|int|false $pkg = false)

Create a new block type set.

Parameters

string $btsHandle
string $btsName
Package|Package|int|false $pkg

Return Value

Set

static exportList(SimpleXMLElement $xml)

Export all the block type sets to a SimpleXMLElement element.

Parameters

SimpleXMLElement $xml The parent SimpleXMLElement element

static BlockType[] getUnassignedBlockTypes(bool $includeInternalBlockTypes = false)

Get the list of block types that don't belong to any block type set.

Parameters

bool $includeInternalBlockTypes

Return Value

BlockType[]

int getBlockTypeSetID()

Get the block type set ID.

Return Value

int

string getBlockTypeSetHandle()

Get the block type set handle.

Return Value

string

string getBlockTypeSetName()

Get the block type set name.

Return Value

string

string getBlockTypeSetDisplayName(string $format = 'html')

Get the block type set name (localized and escaped accordingly to $format).

Parameters

string $format = 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped.

Return Value

string

int|null getPackageID()

Get the ID of the package that defined this set.

Return Value

int|null

string|false getPackageHandle()

Get the handle of the package that defined this set.

Return Value

string|false

updateBlockTypeSetName(string $btsName)

Update the name of this set.

Parameters

string $btsName

updateBlockTypeSetHandle(string $btsHandle)

Update the handle of this set.

Parameters

string $btsHandle

updateBlockTypeSetDisplayOrder(int $displayOrder)

Update the display order of this set.

Parameters

int $displayOrder

addBlockType(BlockType $bt)

Associate a block type to this set.

Parameters

BlockType $bt

setBlockTypeDisplayOrder(BlockType $bt, int $displayOrder)

Update the display order of a block type contained in this set.

Parameters

BlockType $bt The block type to be updated
int $displayOrder the new display order of the blocktype inside this set

clearBlockTypes()

Disassociate all the block types currently associated to this set.

deleteKey(BlockType|int $bt)

Dissociate a specific block type currently associated to this set.

Parameters

BlockType|int $bt A block type (or its ID)

SimpleXMLElement export(SimpleXMLElement $axml)

Export this set to a SimpleXMLElement element.

Parameters

SimpleXMLElement $axml The parent SimpleXMLElement element

Return Value

SimpleXMLElement returns the newly created SimpleXMLElement element representing this set

BlockType[] getBlockTypes()

Get the list of block types associated to this set.

Return Value

BlockType[]

bool contains(BlockType|int $bt)

Does this set contain a block type?

Parameters

BlockType|int $bt A block type (or its ID)

Return Value

bool

int|false displayOrder(BlockType|int $bt)

Get the display order of a block type as sorted for this set.

Parameters

BlockType|int $bt A block type (or its ID)

Return Value

int|false Returns false if the block type is not associated to this set

delete()

Delete this set.

BlockType[] get() deprecated

deprecated This method is an alias of getBlockTypes

Return Value

BlockType[]

protected rescanDisplayOrder()

Regenereate the display order values of the block types associated to this set.