concrete/src/Block/BlockType/Set.php
public static function add($btsHandle, $btsName, $pkg = false)
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $pkgID = (int) (is_object($pkg) ? $pkg->getPackageID() : $pkg);
        $displayOrder = $db->fetchColumn('select max(btsDisplayOrder) from BlockTypeSets');
        if ($displayOrder === null) {
            $displayOrder = 0;
        } else {
            ++$displayOrder;
        }
        $db->insert(
            'BlockTypeSets',
            [
                'btsHandle' => (string) $btsHandle,
                'btsName' => (string) $btsName,
                'pkgID' => $pkgID,
            ]
        );
        $id = $db->lastInsertId();

        $bs = static::getByID($id);

        return $bs;
    }
public static function add($btsHandle, $btsName, $pkg = false)
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $pkgID = (int) (is_object($pkg) ? $pkg->getPackageID() : $pkg);
        $displayOrder = $db->fetchColumn('select max(btsDisplayOrder) from BlockTypeSets');
        if ($displayOrder === null) {
            $displayOrder = 0;
        } else {
            ++$displayOrder;
        }
        $db->insert(
            'BlockTypeSets',
            [
                'btsHandle' => (string) $btsHandle,
                'btsName' => (string) $btsName,
                'pkgID' => $pkgID,
            ]
        );
        $id = $db->lastInsertId();

        $bs = static::getByID($id);

        return $bs;
    }
public static function add ( $ btsHandle , $ btsName , $ pkg = false ) { $ app = Application :: getFacadeApplication ( ) ; $ db = $ app -> make ( Connection :: class ) ; $ pkgID = ( int ) ( is_object ( $ pkg ) ? $ pkg -> getPackageID ( ) : $ pkg ) ; $ displayOrder = $ db -> fetchColumn ( 'select max(btsDisplayOrder) from BlockTypeSets' ) ; if ( $ displayOrder === null ) { $ displayOrder = 0 ; } else { ++ $ displayOrder ; } $ db -> insert ( 'BlockTypeSets' , [ 'btsHandle' => ( string ) $ btsHandle , 'btsName' => ( string ) $ btsName , 'pkgID' => $ pkgID , ] ) ; $ id = $ db -> lastInsertId ( ) ; $ bs = static :: getByID ( $ id ) ; return $ bs ; }
Create a new block type set.

@param string $btsHandle
@param string $btsName
@param \Concrete\Core\Entity\Package|\Concrete\Core\Package\Package|int|false $pkg

@return static
Create a new block type set .