Drupal 8  8.0.2
Block Class Reference
Inheritance diagram for Block:

Public Member Functions

 getPlugin ()
 
 getPluginCollections ()
 
 getPluginId ()
 
 getRegion ()
 
 getTheme ()
 
 getWeight ()
 
 label ()
 
 calculateDependencies ()
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 getVisibility ()
 
 setVisibilityConfig ($instance_id, array $configuration)
 
 getVisibilityConditions ()
 
 getVisibilityCondition ($instance_id)
 
 setRegion ($region)
 
 setWeight ($weight)
 
 createDuplicateBlock ($new_id=NULL, $new_theme=NULL)
 
- Public Member Functions inherited from ConfigEntityBase
 __construct (array $values, $entity_type)
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 isNew ()
 
 get ($property_name)
 
 set ($property_name, $value)
 
 enable ()
 
 disable ()
 
 setStatus ($status)
 
 status ()
 
 setSyncing ($syncing)
 
 isSyncing ()
 
 setUninstalling ($uninstalling)
 
 isUninstalling ()
 
 createDuplicate ()
 
 preSave (EntityStorageInterface $storage)
 
 calculateDependencies ()
 
 urlInfo ($rel= 'edit-form', array $options=[])
 
 url ($rel= 'edit-form', $options=array())
 
 link ($text=NULL, $rel= 'edit-form', array $options=[])
 
 toUrl ($rel= 'edit-form', array $options=[])
 
 getCacheTagsToInvalidate ()
 
 getDependencies ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
 onDependencyRemoval (array $dependencies)
 
 setThirdPartySetting ($module, $key, $value)
 
 getThirdPartySetting ($module, $key, $default=NULL)
 
 getThirdPartySettings ($module)
 
 unsetThirdPartySetting ($module, $key)
 
 getThirdPartyProviders ()
 
 isInstallable ()
 
 trustData ()
 
 hasTrustedData ()
 
 save ()
 
- Public Member Functions inherited from Entity
 __construct (array $values, $entity_type)
 
 id ()
 
 uuid ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=[])
 
 toUrl ($rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($rel)
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 url ($rel= 'canonical', $options=array())
 
 uriRelationships ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 save ()
 
 delete ()
 
 createDuplicate ()
 
 getEntityType ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 referencedEntities ()
 
 getCacheContexts ()
 
 getCacheTagsToInvalidate ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 __sleep ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 

Static Public Member Functions

static sort (ConfigEntityInterface $a, ConfigEntityInterface $b)
 
- Static Public Member Functions inherited from ConfigEntityBase
static sort (ConfigEntityInterface $a, ConfigEntityInterface $b)
 
- Static Public Member Functions inherited from Entity
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 

Protected Member Functions

 getPluginCollection ()
 
 conditionPluginManager ()
 
- Protected Member Functions inherited from ConfigEntityBase
 getTypedConfig ()
 
 addDependency ($type, $name)
 
 invalidateTagsOnSave ($update)
 
- Protected Member Functions inherited from Entity
 entityManager ()
 
 entityTypeManager ()
 
 languageManager ()
 
 uuidGenerator ()
 
 linkTemplates ()
 
 urlRouteParameters ($rel)
 
 invalidateTagsOnSave ($update)
 

Protected Attributes

 $id
 
 $settings = array()
 
 $region = self::BLOCK_REGION_NONE
 
 $weight
 
 $plugin
 
 $visibility = []
 
 $pluginCollection
 
 $contexts = []
 
 $visibilityCollection
 
 $conditionPluginManager
 
 $theme
 
- Protected Attributes inherited from ConfigEntityBase
 $originalId
 
 $pluginConfigKey
 
 $status = TRUE
 
 $uuid
 
 $langcode = 'en'
 
 $third_party_settings = array()
 
 $_core = []
 
 $trustedData = FALSE
 
- Protected Attributes inherited from Entity
 $entityTypeId
 
 $enforceIsNew
 
 $typedData
 

Additional Inherited Members

- Data Fields inherited from BlockInterface
const BLOCK_LABEL_VISIBLE = 'visible'
 
const BLOCK_REGION_NONE = -1
 
- Static Protected Member Functions inherited from ConfigEntityBase
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 
static getConfigManager ()
 
- Static Protected Member Functions inherited from Entity
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 

Detailed Description

Defines a Block configuration entity class.

( id = "block", label = ("Block"), handlers = { "access" = "Drupal\block\BlockAccessControlHandler", "view_builder" = "Drupal\block\BlockViewBuilder", "list_builder" = "Drupal\block\BlockListBuilder", "form" = { "default" = "Drupal\block\BlockForm", "delete" = "Drupal\block\Form\BlockDeleteForm" } }, admin_permission = "administer blocks", entity_keys = { "id" = "id" }, links = { "delete-form" = "/admin/structure/block/manage/{block}/delete", "edit-form" = "/admin/structure/block/manage/{block}" }, config_export = { "id", "theme", "region", "weight", "provider", "plugin", "settings", "visibility", }, lookup_keys = { "theme" } )

Member Function Documentation

calculateDependencies ( )

{Calculates dependencies and stores them in the dependency property.

Returns
$this
See Also
}

Implements ConfigEntityInterface.

References ConfigEntityBase\addDependency(), and Drupal\theme().

Here is the call graph for this function:

conditionPluginManager ( )
protected

Gets the condition plugin manager.

Returns
The condition plugin manager.

References Drupal\service().

Referenced by Block\getVisibilityConditions().

Here is the call graph for this function:

Here is the caller graph for this function:

createDuplicateBlock (   $new_id = NULL,
  $new_theme = NULL 
)

{Creates a duplicate of the block entity.

Parameters
string$new_id(optional) The new ID on the duplicate block.
string$new_theme(optional) The theme on the duplicate block.
Returns
static A clone of $this with all identifiers unset, so saving it inserts a new entity into the storage system.
}

Implements BlockInterface.

getPlugin ( )

{Returns the plugin instance.

Returns
The plugin instance for this block.
}

Implements BlockInterface.

References Block\getPluginCollection().

Referenced by Block\label().

Here is the call graph for this function:

Here is the caller graph for this function:

getPluginCollection ( )
protected

Encapsulates the creation of the block's LazyPluginCollection.

Returns
The block's plugin collection.

References Drupal\service().

Referenced by Block\getPlugin(), and Block\getPluginCollections().

Here is the call graph for this function:

Here is the caller graph for this function:

getPluginCollections ( )

{Gets the plugin collections used by this entity.

Returns
[] An array of plugin collections, keyed by the property name they use to store their configuration.
}

Implements EntityWithPluginCollectionInterface.

References Block\getPluginCollection(), and Block\getVisibilityConditions().

Here is the call graph for this function:

getPluginId ( )

{Returns the plugin ID.

Returns
string The plugin ID for this block.
}

Implements BlockInterface.

getRegion ( )

{Returns the region this block is placed in.

Returns
string The region this block is placed in.
}

Implements BlockInterface.

getTheme ( )

{Returns the theme ID.

Returns
string The theme ID for this block instance.
}

Implements BlockInterface.

getVisibility ( )

{Returns an array of visibility condition configurations.

Returns
array An array of visibility condition configuration keyed by the condition ID.
}

Implements BlockInterface.

References Block\getVisibilityConditions().

Here is the call graph for this function:

getVisibilityCondition (   $instance_id)

{Gets a visibility condition plugin instance.

Parameters
string$instance_idThe condition plugin instance ID.
Returns
A condition plugin.
}

Implements BlockInterface.

References Block\getVisibilityConditions().

Here is the call graph for this function:

getVisibilityConditions ( )

{Gets conditions for this block.

Returns
[]| An array or collection of configured condition plugins.
}

Implements BlockInterface.

References Block\conditionPluginManager().

Referenced by Block\getPluginCollections(), Block\getVisibility(), Block\getVisibilityCondition(), and Block\setVisibilityConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

getWeight ( )

{Returns the weight of this block (used for sorting).

Returns
int The block weight.
}

Implements BlockInterface.

label ( )

{Gets the label of the entity.

Returns
string|null The label of the entity, or NULL if there is no label defined.
}

Implements EntityInterface.

References Block\getPlugin().

Here is the call graph for this function:

postSave ( EntityStorageInterface  $storage,
  $update = TRUE 
)

{Acts on a saved entity before the insert or update hook is invoked.Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
bool$updateTRUE if the entity has been updated, or FALSE if it has been inserted.
}

Implements EntityInterface.

References ConfigEntityBase\getCacheTagsToInvalidate(), and Cache\invalidateTags().

Here is the call graph for this function:

setRegion (   $region)

{Sets the region this block is placed in.

Parameters
string$regionThe region to place this block in.
Returns
$this
}

Implements BlockInterface.

setVisibilityConfig (   $instance_id,
array  $configuration 
)

{Sets the visibility condition configuration.

Parameters
string$instance_idThe condition instance ID.
array$configurationThe condition configuration.
Returns
$this
}

Implements BlockInterface.

References Block\getVisibilityConditions().

Here is the call graph for this function:

setWeight (   $weight)

{Sets the block weight.

Parameters
int$weightThe desired weight.
Returns
$this
}

Implements BlockInterface.

static sort ( ConfigEntityInterface  $a,
ConfigEntityInterface  $b 
)
static

Sorts active blocks by weight; sorts inactive blocks by name.

References EntityInterface\label(), and ConfigEntityInterface\status().

Here is the call graph for this function:


The documentation for this class was generated from the following file: