concrete/src/Block/Block.php
public function setCustomCacheSettings($enabled, $enabledOnPost, $enabledForRegistered, $lifetime)
    {
        $db = Loader::db();
        $c = $this->getBlockCollectionObject();
        $cvID = $c->getVersionID();

        $enabled = (bool) $enabled;
        $enabledOnPost = (bool) $enabledOnPost;
        $enabledForRegistered = (bool) $enabledForRegistered;
        $lifetime = (int) $lifetime;

        $db->Replace(
            'CollectionVersionBlocksCacheSettings',
            [
                'cID' => $this->getBlockCollectionID(),
                'cvID' => $cvID,
                'arHandle' => $this->getAreaHandle(),
                'bID' => $this->getBlockID(),
                'btCacheBlockOutput' => (int) $enabled,
                'btCacheBlockOutputOnPost' => (int) $enabledOnPost,
                'btCacheBlockOutputForRegisteredUsers' => (int) $enabledForRegistered,
                'btCacheBlockOutputLifetime' => (int) $lifetime,
            ],
            [
                'cID',
                'cvID',
                'bID',
                'arHandle',
            ],
            true
            );
        $db->update(
            'CollectionVersionBlocks',
            ['cbOverrideBlockTypeCacheSettings' => 1],
            [
                'cID' => $this->getBlockCollectionID(),
                'cvID' => $cvID,
                'arHandle' => $this->getAreaHandle(),
                'bID' => $this->getBlockID(),
            ]
            );
    }
public function setCustomCacheSettings($enabled, $enabledOnPost, $enabledForRegistered, $lifetime)
    {
        $db = Loader::db();
        $c = $this->getBlockCollectionObject();
        $cvID = $c->getVersionID();

        $enabled = (bool) $enabled;
        $enabledOnPost = (bool) $enabledOnPost;
        $enabledForRegistered = (bool) $enabledForRegistered;
        $lifetime = (int) $lifetime;

        $db->Replace(
            'CollectionVersionBlocksCacheSettings',
            [
                'cID' => $this->getBlockCollectionID(),
                'cvID' => $cvID,
                'arHandle' => $this->getAreaHandle(),
                'bID' => $this->getBlockID(),
                'btCacheBlockOutput' => (int) $enabled,
                'btCacheBlockOutputOnPost' => (int) $enabledOnPost,
                'btCacheBlockOutputForRegisteredUsers' => (int) $enabledForRegistered,
                'btCacheBlockOutputLifetime' => (int) $lifetime,
            ],
            [
                'cID',
                'cvID',
                'bID',
                'arHandle',
            ],
            true
            );
        $db->update(
            'CollectionVersionBlocks',
            ['cbOverrideBlockTypeCacheSettings' => 1],
            [
                'cID' => $this->getBlockCollectionID(),
                'cvID' => $cvID,
                'arHandle' => $this->getAreaHandle(),
                'bID' => $this->getBlockID(),
            ]
            );
    }
public function setCustomCacheSettings ( $ enabled , $ enabledOnPost , $ enabledForRegistered , $ lifetime ) { $ db = Loader :: db ( ) ; $ c = $ this -> getBlockCollectionObject ( ) ; $ cvID = $ c -> getVersionID ( ) ; $ enabled = ( bool ) $ enabled ; $ enabledOnPost = ( bool ) $ enabledOnPost ; $ enabledForRegistered = ( bool ) $ enabledForRegistered ; $ lifetime = ( int ) $ lifetime ; $ db -> Replace ( 'CollectionVersionBlocksCacheSettings' , [ 'cID' => $ this -> getBlockCollectionID ( ) , 'cvID' => $ cvID , 'arHandle' => $ this -> getAreaHandle ( ) , 'bID' => $ this -> getBlockID ( ) , 'btCacheBlockOutput' => ( int ) $ enabled , 'btCacheBlockOutputOnPost' => ( int ) $ enabledOnPost , 'btCacheBlockOutputForRegisteredUsers' => ( int ) $ enabledForRegistered , 'btCacheBlockOutputLifetime' => ( int ) $ lifetime , ] , [ 'cID' , 'cvID' , 'bID' , 'arHandle' , ] , true ) ; $ db -> update ( 'CollectionVersionBlocks' , [ 'cbOverrideBlockTypeCacheSettings' => 1 ] , [ 'cID' => $ this -> getBlockCollectionID ( ) , 'cvID' => $ cvID , 'arHandle' => $ this -> getAreaHandle ( ) , 'bID' => $ this -> getBlockID ( ) , ] ) ; }
Customize the cache settings, overriding the values of the block type controller.

@param bool $enabled Should the block output be cached?
@param bool $enabledOnPost Should the block output be cached upon POST requests?
@param bool $enabledForRegistered Should the block output be cached when site visitors are registered users?
@param int $lifetime cache lifetime (in seconds); if empty we'll assume 5 years
Customize the cache settings overriding the values of the block type controller .