Block
class Block extends ConcreteObject implements ObjectInterface (View source)
Properties
$error | from ConcreteObject | ||
Area|null deprecated | $a | ||
string|null | $bName | ||
int|null | $btID | ||
BlockController|null | $instance | ||
protected int|null | $cID | The ID of the collection containing the block. |
|
protected string|null | $arHandle | The handle of the area containing the block. |
|
protected Collection|null | $c | The collection instance containing the block. |
|
protected int|null | $issID | The custom style set ID. |
|
protected Block|false | $proxyBlock | The proxy block instance. |
|
protected int|null | $cbRelationID | The ID of the associated block. |
|
protected int|null | $bActionCID | The ID of the collection that's associated to the block actions. |
|
protected CacheSettings|null | $cacheSettings | The block cache settings. |
|
protected int|null | $cbOverrideBlockTypeCacheSettings | Override cache settings? |
|
protected string|null | $bFilename | The custom template name. |
|
protected bool|int|null | $isOriginal | ||
protected string|null | $btHandle | ||
protected string|null | $btName | ||
protected int|null | $uID | ||
protected string|null | $bDateAdded | ||
protected string|null | $bDateModified | ||
protected int|null | $bIsActive | ||
protected int|null | $cbIncludeAll | ||
protected | $cbOverrideBlockTypeContainerSettings | ||
protected bool|int|null | $cbEnableBlockContainer | ||
protected int|null | $cbOverrideAreaPermissions | ||
protected string|null | $btCachedBlockRecord |
Methods
Destruct the class instance.
Get a block instance given its ID.
Initialize the instance by manually specifying the data.
Returns the block identifier (if available).
Get the absolute path of the block directory (.../blocks/block_handle).
Get the block name.
Set the name of the block.
Get the name of the custom template.
No description
Removes the block cache records (on this object) to null disables all cache on the cache object
Set the name of the custom template.
Get the ID of the block type (if available).
Get the block type instance.
Get the block type handle.
Get the block type name.
Get the ID of the user that created the block instance.
Gets the date/time when block was added (in the system time zone).
Gets the date/time when block was last modified (in the system time zone).
Get the ID of the package owning this block type.
Get the handle of the package owning this block type.
Get the ID of the collection containing the block.
Get the collection instance containing the block.
Get the page instance where this block is defined (or the page where the original block is defined if this block is an alias).
Gets a list of pages that include this block, along with area name, etc.
Get the handle of the area containing the block.
Get the the instance of the Area containing the block.
Get the block display order (if available).
Move this block after another block (in the block page & area).
Set the absolute position of this block, regardless other blocks in the same page & area.
Get the proxy block instance.
Get the ID of the associated block.
Get the ID of the collection that's associated to the block actions (or false if not found).
Set the ID of the collection that's associated to the block actions.
Does this block have an edit user interface?
Is the block active?
Deactivate the block.
Activate the block.
Is the block versioning disabled?
No description
No description
Check if this block is an alias from a page default.
Get the number of alias of this block.
Is this block inside a stack?
Get the ID of the custom style set.
Get the custom style object associated to this block.
Remove the block custom styles.
Get the cache settings instance.
Override cache settings?
Customize the cache settings, overriding the values of the block type controller.
Reset the cache settings, so that Concrete will use the values of the block type controller.
Get the cached record of the block instance.
Should the block output be cached?
Should the block output be cached upon POST requests?
Should the block output be cached when site visitors are registered users?
Get the lifetime (in seconds) of the block output cache.
Get the cached output of the block instance (if available and not expired).
Mark the output cache as expired.
Refreshes the block record cache.
Area permissions are overridden?
Mark the block as having permissions that override the ones of the area.
Revert the permission of the object to the one of the area that contains the block.
Is the block grid container enabled?
Should the view ignore the grid container?
Should this instance override the grid container settings of the block controller?
Set the custom settings related to the grid container (overriding the block type default values).
Reset the settings related to the grid container to the block type default values.
Disable the original block container for the current request.
No description
No description
No description
No description
Get the block type controller.
Render the block display.
Include a file (if it exists).
Updates fields common to every block.
Update the block information, like its block filename, and block name.
Duplicate this block to a new collection. Runs the $controllerMethodToTryAndRun on the block controller to copy relevant data for a particular context. Valid options for $controllerMethodToTryAndRun are 'duplicate', 'duplicate_master' and 'duplicate_clipboard'. If a method is specified but does not exist we fall back to duplicate in all situations.
Create an alias of the block, attached to this collection, within the CollectionVersionBlocks table.
Delete this block instance.
Export the data associated to this block to an XML node.
Populate the queue to be used to add/update blocks of the pages of a specific type.
Populate the queue to be used to work on the block and it aliases.
Details
loadError($error)
No description
isError()
No description
getError()
No description
setPropertiesFromArray($arr)
No description
static
camelcase($file)
No description
static
uncamelcase($string)
No description
__destruct()
Destruct the class instance.
static Block|false|null
getByID(int $bID, Collection|null $c = null, Area|string|null $a = null)
Get a block instance given its ID.
static Block|null
getByName(string $blockName)
Get a block instance given its name.
static Block
populateManually(array|Iterator $blockInfo, Collection $c, Area|string|null $a)
Initialize the instance by manually specifying the data.
int|null
getBlockID()
Returns the block identifier (if available).
string
getBlockPath()
Get the absolute path of the block directory (.../blocks/block_handle).
string|null
getBlockName()
Get the block name.
setName(string $name)
Set the name of the block.
string|null
getBlockFilename()
Get the name of the custom template.
void
setTempFilename(string $bFilename = null)
No description
void
temporaryClearBlockCache()
Removes the block cache records (on this object) to null disables all cache on the cache object
setCustomTemplate(string $template)
Set the name of the custom template.
int|null
getBlockTypeID()
Get the ID of the block type (if available).
BlockType|null
getBlockTypeObject()
Get the block type instance.
string|null
getBlockTypeHandle()
Get the block type handle.
string|null
getBlockTypeName()
Get the block type name.
int|null
getBlockUserID()
Get the ID of the user that created the block instance.
string|null
getBlockDateAdded()
Gets the date/time when block was added (in the system time zone).
string|null
getBlockDateLastModified()
Gets the date/time when block was last modified (in the system time zone).
int|null
getPackageID()
Get the ID of the package owning this block type.
string|false
getPackageHandle()
Get the handle of the package owning this block type.
int|null
getBlockCollectionID()
Get the ID of the collection containing the block.
Page|Collection|null
getBlockCollectionObject()
Get the collection instance containing the block.
Page|null
getOriginalCollection()
Get the page instance where this block is defined (or the page where the original block is defined if this block is an alias).
Page[]
getPageList()
Gets a list of pages that include this block, along with area name, etc.
..
void
setBlockCollectionObject(Collection $c)
Set the collection instance containing the block.
string|null
getAreaHandle()
Get the handle of the area containing the block.
Area|null
getBlockAreaObject()
Get the the instance of the Area containing the block.
void
setBlockAreaObject(Area $a)
Set the area containing the block.
int|null
getBlockDisplayOrder()
Get the block display order (if available).
moveBlockToDisplayOrderPosition(Block|null $afterBlock)
Move this block after another block (in the block page & area).
setAbsoluteBlockDisplayOrder(int $do)
Set the absolute position of this block, regardless other blocks in the same page & area.
Block|false
getProxyBlock()
Get the proxy block instance.
setProxyBlock(Block|null $block)
Set the proxy block instance.
int|null
getBlockRelationID()
Get the ID of the associated block.
int|false
getBlockActionCollectionID()
Get the ID of the collection that's associated to the block actions (or false if not found).
setBlockActionCollectionID(int|null $bActionCID)
Set the ID of the collection that's associated to the block actions.
bool
isEditable()
Does this block have an edit user interface?
int
isActive()
Is the block active?
deactivate()
Deactivate the block.
activate()
Activate the block.
int
disableBlockVersioning()
Is the block versioning disabled?
bool|null
isAlias(Collection|null $c = null)
Check if this block instance is an alias.
void
setOriginal(bool $isOriginal)
No description
bool|null
isOriginal()
No description
bool
isAliasOfMasterCollection()
Check if this block is an alias from a page default.
int
getNumChildren()
Get the number of alias of this block.
bool
isBlockInStack()
Is this block inside a stack?
int
getCustomStyleSetID()
Get the ID of the custom style set.
CustomStyle|null
getCustomStyle(bool $force = false)
Get the custom style object associated to this block.
setCustomStyleSet(StyleSet $set)
Set the block custom styles.
resetCustomStyle()
Remove the block custom styles.
CacheSettings
getBlockCacheSettingsObject()
Get the cache settings instance.
int|null
overrideBlockTypeCacheSettings()
Override cache settings?
setCustomCacheSettings(bool $enabled, bool $enabledOnPost, bool $enabledForRegistered, int $lifetime)
Customize the cache settings, overriding the values of the block type controller.
resetCustomCacheSettings()
Reset the cache settings, so that Concrete will use the values of the block type controller.
string|null
getBlockCachedRecord()
Get the cached record of the block instance.
bool
cacheBlockOutput()
Should the block output be cached?
bool
cacheBlockOutputOnPost()
Should the block output be cached upon POST requests?
bool
cacheBlockOutputForRegisteredUsers()
Should the block output be cached when site visitors are registered users?
int
getBlockOutputCacheLifetime()
Get the lifetime (in seconds) of the block output cache.
setBlockCachedOutput(string $content, int|null $lifetime, Area|null $area)
Set the output cache.
string|false
getBlockCachedOutput(Area|null $area)
Get the cached output of the block instance (if available and not expired).
refreshBlockOutputCache()
Mark the output cache as expired.
refreshBlockRecordCache()
Refreshes the block record cache.
The block record contains information from the block's $btTable.
int|null
overrideAreaPermissions()
Area permissions are overridden?
doOverrideAreaPermissions()
Mark the block as having permissions that override the ones of the area.
Initial permissions are copied from the page/area.
revertToAreaPermissions()
Revert the permission of the object to the one of the area that contains the block.
bool
enableBlockContainer()
Is the block grid container enabled?
bool
ignorePageThemeGridFrameworkContainer()
Should the view ignore the grid container?
int
overrideBlockTypeContainerSettings()
Should this instance override the grid container settings of the block controller?
setCustomContainerSettings(bool $enableBlockContainer)
Set the custom settings related to the grid container (overriding the block type default values).
resetBlockContainerSettings()
Reset the settings related to the grid container to the block type default values.
disableBlockContainer()
Disable the original block container for the current request.
This is called by the scrapbook proxy block, because the scrapbook block takes care of rendering the container.
getPermissionObjectIdentifier()
No description
getPermissionResponseClassName()
No description
getPermissionAssignmentClassName()
No description
getPermissionObjectKeyCategoryHandle()
No description
BlockController
getController()
Get the block type controller.
display(string $view = 'view')
Render the block display.
inc(string $file)
Include a file (if it exists).
update(array $data)
Updates fields common to every block.
updateBlockInformation(array $data)
Update the block information, like its block filename, and block name.
bool
move(Collection $collection, Area $area)
Move the block to a new collection and/or area.
Block|false
duplicate(Collection $nc, string $controllerMethodToTryAndRun = 'duplicate')
Duplicate this block to a new collection. Runs the $controllerMethodToTryAndRun on the block controller to copy relevant data for a particular context. Valid options for $controllerMethodToTryAndRun are 'duplicate', 'duplicate_master' and 'duplicate_clipboard'. If a method is specified but does not exist we fall back to duplicate in all situations.
alias(Collection $c, int $displayOrder = null)
Create an alias of the block, attached to this collection, within the CollectionVersionBlocks table.
Additionally, this command grabs the permissions from the original record in the CollectionVersionBlocks table, and attaches them to the new one.
bool|void
deleteBlock(bool $forceDelete = false)
Delete this block instance.
export(SimpleXMLElement $node, string $exportType = 'full')
Export the data associated to this block to an XML node.
array
queueForDefaultsAliasing(bool $addBlock, bool $updateForkedBlocks, bool $forceDisplayOrder = false)
Populate the queue to be used to add/update blocks of the pages of a specific type.
queueForDefaultsUpdate(mixed $data, bool $includeThisBlock = true)
Populate the queue to be used to work on the block and it aliases.
loadNewCollection(Collection $c)
deprecated
deprecated
No description
string
_getBlockAction()
deprecated
deprecated
No description
string
getBlockEditAction()
deprecated
deprecated
No description
string
getBlockUpdateInformationAction()
deprecated
deprecated
No description
string
getBlockUpdateCssAction()
deprecated
deprecated
No description
bool
isGlobal()
deprecated
deprecated
No description
BlockController
getInstance()
deprecated
deprecated
No description
delete(bool $forceDelete = false)
deprecated
deprecated
No description
refreshCache()
deprecated
deprecated
No description
refreshCacheAll()
deprecated
deprecated
No description