This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Model_BlockType

Any type of content that can be added to pages is represented as a type of block, and thereby a block type object.

Concrete5_Library_Object
Extended by Object
Extended by Concrete5_Model_BlockType

Direct known subclasses

BlockType

Package: Blocks
Category: Concrete
License: MIT License
Author: Andrew Embler andrew@concrete5.org
Located at core/models/block_types.php

Methods summary

public static BlockType|false
# getByHandle( string $handle )

Gets the BlockType object for the given Block Type Handle ex:

<?php
$bt = BlockType::getByHandle('content'); // returns the BlockType object for the core Content block
?>
public static BlockType
# getByID( integer $btID )

Gets the BlockType for a given Block Type ID

protected static
# get( string $where, array $properties )

internal method to query the BlockTypes table and get a BlockType object

public boolean
# isBlockTypeInternal( )

if a the current BlockType is Internal or not - meaning one of the core built-in concrete5 blocks

public boolean
# isInternalBlockType( )

Returns true if the block type is internal (and therefore cannot be removed) a core block

public
# isCoreBlockType( )

Returns true if the block type ships with concrete5 by checking to see if it's in the concrete/blocks/ directory

public boolean
# hasAddTemplate( )

Determines if the block type has templates available

public integer
# getBlockTypeInterfaceWidth( )

returns the width in pixels that the block type's editing dialog will open in

public integer
# getBlockTypeInterfaceHeight( )

returns the height in pixels that the block type's editing dialog will open in

public integer
# getPackageID( )

returns the id of the BlockType's package if it's in a package

public string
# getPackageHandle( )

returns the handle of the BlockType's package if it's in a package

public boolean
# canAddBlock( UserInfo|Group $obj )

determines if a user or group can add a block of the current BlockType

public integer
# getCount( boolean $ignoreUnapprovedVersions = false )

Returns the number of unique instances of this block throughout the entire site note - this count could include blocks in areas that are no longer rendered by the theme

public boolean
# canUnInstall( )

Not a permissions call. Actually checks to see whether this block is not an internal one.

public string
# getBlockTypeDescription( )

gets the BlockTypes description text

public TemplateFile[]
# getBlockTypeCustomTemplates( )

Gets the custom templates available for the current BlockType

public TemplateFile[]
# getBlockTypeComposerTemplates( )

gets the available composer templates used for editing instances of the BlockType while in the composer ui in the dashboard

public
# setBlockTypeDisplayOrder( $displayOrder )
public |string
# installBlockTypeFromPackage( string $btHandle, Package $pkg, integer $btID = 0 )

installs a new BlockType from a package, typicaly called from a package controller's install() method durring package installation

public
# refresh( )

refreshes the BlockType's database schema throws an Exception if error

public
# installBlockType( string $btHandle, integer $btID = 0 )

installs a core or root level BlockType (from /blocks or /concrete/blocks, not a package) should likely be a static method

public
# render( string $view = 'view' )

Renders a particular view of a block type, using the public $controller variable as the block type's controller

public BlockTypeController
# getController( )

get's the block type controller

protected
# doInstallBlockType( string $btHandle, BlockType $bt, string $dir, integer $btID, string $dirDbXml )

installs a block type

public
protected
public
# inc( $file, $args = array() )
public
public
# getBlockTypeClassFromHandle( )

Deprecated -- use getBlockTypeClass() instead.

public
# delete( )

Removes the block type. Also removes instances of content.

public
# update( array $data )

Allows block types to be updated

public
# add( $data, $c = false, $a = false )
public
public
public
# getBlockAddAction( & $a, $alternateHandler = null )
public
public
public
public
public
public
public
public

Properties summary

public array $addBTUArray

$addBTUArray

# array()
public array $addBTGArray

$addBTGArray

# array()
public BlockTypeController $controller
#

Properties inherited from Concrete5_Library_Object

$error