src/Database/Observers/BlockTypeObserver.php
/**
     * Listen to the Block saved event.
     *
     * @param BlockTypeInterface $blockType
     */
Listen to the Block saved event.
Listen to the Block saved event .
public function saved(BlockTypeInterface $blockType)
    {
        if ($blockType->isDirty('is_shared')) {
            DynamicBlock::fromTable($blockType->getAttribute('identifier'))->update(['is_shared' => $blockType->getAttribute('is_shared')]);
        }
        if ($blockType->isDirty('identifier')) {
            DynamicBlock::fromTable($blockType->getAttribute('identifier'))->update(['is_shared' => $blockType->getAttribute('is_shared')]);
        }
        if (! $blockType->dynamicTableExists()) {
            $blockType->createTable();
        }
    }
public function saved ( BlockTypeInterface $ blockType ) { if ( $ blockType -> isDirty ( 'is_shared' ) ) { DynamicBlock :: fromTable ( $ blockType -> getAttribute ( 'identifier' ) ) -> update ( [ 'is_shared' => $ blockType -> getAttribute ( 'is_shared' ) ] ) ; } if ( $ blockType -> isDirty ( 'identifier' ) ) { DynamicBlock :: fromTable ( $ blockType -> getAttribute ( 'identifier' ) ) -> update ( [ 'is_shared' => $ blockType -> getAttribute ( 'is_shared' ) ] ) ; } if ( ! $ blockType -> dynamicTableExists ( ) ) { $ blockType -> createTable ( ) ; } }
Listen to the Block saved event.
Listen to the Block saved event .