concrete/src/Block/BlockType/Set.php
public function addBlockType(BlockTypeEntity $bt)
    {
        if (!$this->contains($bt)) {
            $app = Application::getFacadeApplication();
            $db = $app->make(Connection::class);
            $displayOrder = $db->fetchColumn('select max(displayOrder) from BlockTypeSetBlockTypes where btsID = ?', [$this->getBlockTypeSetID()]);
            if ($displayOrder === null) {
                $displayOrder = 0;
            } else {
                ++$displayOrder;
            }
            $db->insert(
                'BlockTypeSetBlockTypes',
                [
                    'btsID' => $this->getBlockTypeSetID(),
                    'btID' => $bt->getBlockTypeID(),
                    'displayOrder' => $displayOrder,
                ]
            );
        }
    }
public function addBlockType(BlockTypeEntity $bt)
    {
        if (!$this->contains($bt)) {
            $app = Application::getFacadeApplication();
            $db = $app->make(Connection::class);
            $displayOrder = $db->fetchColumn('select max(displayOrder) from BlockTypeSetBlockTypes where btsID = ?', [$this->getBlockTypeSetID()]);
            if ($displayOrder === null) {
                $displayOrder = 0;
            } else {
                ++$displayOrder;
            }
            $db->insert(
                'BlockTypeSetBlockTypes',
                [
                    'btsID' => $this->getBlockTypeSetID(),
                    'btID' => $bt->getBlockTypeID(),
                    'displayOrder' => $displayOrder,
                ]
            );
        }
    }
public function addBlockType ( BlockTypeEntity $ bt ) { if ( ! $ this -> contains ( $ bt ) ) { $ app = Application :: getFacadeApplication ( ) ; $ db = $ app -> make ( Connection :: class ) ; $ displayOrder = $ db -> fetchColumn ( 'select max(displayOrder) from BlockTypeSetBlockTypes where btsID = ?' , [ $ this -> getBlockTypeSetID ( ) ] ) ; if ( $ displayOrder === null ) { $ displayOrder = 0 ; } else { ++ $ displayOrder ; } $ db -> insert ( 'BlockTypeSetBlockTypes' , [ 'btsID' => $ this -> getBlockTypeSetID ( ) , 'btID' => $ bt -> getBlockTypeID ( ) , 'displayOrder' => $ displayOrder , ] ) ; } }
Associate a block type to this set.

@param \Concrete\Core\Entity\Block\BlockType\BlockType $bt
Associate a block type to this set .