private function _getBlockTypeRecord($blockType): SuperTableBlockTypeRecord
    {
        if (is_string($blockType)) {
            $blockTypeRecord = SuperTableBlockTypeRecord::findOne(['uid' => $blockType]) ?? new SuperTableBlockTypeRecord();

            if (!$blockTypeRecord->getIsNewRecord()) {
                $this->_blockTypeRecordsById[$blockTypeRecord->id] = $blockTypeRecord;
            }

            return $blockTypeRecord;
        }

        if ($blockType->getIsNew()) {
            return new SuperTableBlockTypeRecord();
        }

        if (isset($this->_blockTypeRecordsById[$blockType->id])) {
            return $this->_blockTypeRecordsById[$blockType->id];
        }

        $blockTypeRecord = SuperTableBlockTypeRecord::findOne($blockType->id);

        if ($blockTypeRecord === null) {
            throw new SuperTableBlockTypeNotFoundException('Invalid block type ID: ' . $blockType->id);
        }

        return $this->_blockTypeRecordsById[$blockType->id] = $blockTypeRecord;
    }
private function _getBlockTypeRecord($blockType): SuperTableBlockTypeRecord
    {
        if (is_string($blockType)) {
            $blockTypeRecord = SuperTableBlockTypeRecord::findOne(['uid' => $blockType]) ?? new SuperTableBlockTypeRecord();

            if (!$blockTypeRecord->getIsNewRecord()) {
                $this->_blockTypeRecordsById[$blockTypeRecord->id] = $blockTypeRecord;
            }

            return $blockTypeRecord;
        }

        if ($blockType->getIsNew()) {
            return new SuperTableBlockTypeRecord();
        }

        if (isset($this->_blockTypeRecordsById[$blockType->id])) {
            return $this->_blockTypeRecordsById[$blockType->id];
        }

        $blockTypeRecord = SuperTableBlockTypeRecord::findOne($blockType->id);

        if ($blockTypeRecord === null) {
            throw new SuperTableBlockTypeNotFoundException('Invalid block type ID: ' . $blockType->id);
        }

        return $this->_blockTypeRecordsById[$blockType->id] = $blockTypeRecord;
    }
private function _getBlockTypeRecord ( $ blockType ) : SuperTableBlockTypeRecord { if ( is_string ( $ blockType ) ) { $ blockTypeRecord = SuperTableBlockTypeRecord :: findOne ( [ 'uid' => $ blockType ] ) ?? new SuperTableBlockTypeRecord ( ) ; if ( ! $ blockTypeRecord -> getIsNewRecord ( ) ) { $ this -> _blockTypeRecordsById [ $ blockTypeRecord -> id ] = $ blockTypeRecord ; } return $ blockTypeRecord ; } if ( $ blockType -> getIsNew ( ) ) { return new SuperTableBlockTypeRecord ( ) ; } if ( isset ( $ this -> _blockTypeRecordsById [ $ blockType -> id ] ) ) { return $ this -> _blockTypeRecordsById [ $ blockType -> id ] ; } $ blockTypeRecord = SuperTableBlockTypeRecord :: findOne ( $ blockType -> id ) ; if ( $ blockTypeRecord === null ) { throw new SuperTableBlockTypeNotFoundException ( 'Invalid block type ID: ' . $ blockType -> id ) ; } return $ this -> _blockTypeRecordsById [ $ blockType -> id ] = $ blockTypeRecord ; }
Returns a block type record by its ID or creates a new one.

@param SuperTableBlockTypeModel $blockType

@return SuperTableBlockTypeRecord
@throws SuperTableBlockTypeNotFoundException if $blockType->id is invalid
Returns a block type record by its ID or creates a new one .