concrete/src/Block/BlockController.php
protected function performSave($args, $loadExisting = false)
    {
        //$argsMerged = array_merge($_POST, $args);
        if ($this->btTable) {
            $db = Database::connection();
            $columns = $db->MetaColumnNames($this->btTable);
            $this->record = new BlockRecord($this->btTable);
            $this->record->bID = $this->bID;
            if ($loadExisting) {
                $this->record->Load('bID=' . $this->bID);
            }

            if ($this->supportSavingNullValues) {
                foreach ($columns as $key) {
                    if (array_key_exists($key, $args)) {
                        $this->record->{$key} = $args[$key];
                    }
                }
            } else {
                foreach ($columns as $key) {
                    if (isset($args[$key])) {
                        $this->record->{$key} = $args[$key];
                    }
                }
            }

            $this->record->Replace();
            if ($this->cacheBlockRecord() && Config::get('concrete.cache.blocks')) {
                $record = base64_encode(serialize($this->record));
                $db = Database::connection();
                $db->Execute('update Blocks set btCachedBlockRecord = ? where bID = ?', [$record, $this->bID]);
            }
        }
    }
protected function performSave($args, $loadExisting = false)
    {
        //$argsMerged = array_merge($_POST, $args);
        if ($this->btTable) {
            $db = Database::connection();
            $columns = $db->MetaColumnNames($this->btTable);
            $this->record = new BlockRecord($this->btTable);
            $this->record->bID = $this->bID;
            if ($loadExisting) {
                $this->record->Load('bID=' . $this->bID);
            }

            if ($this->supportSavingNullValues) {
                foreach ($columns as $key) {
                    if (array_key_exists($key, $args)) {
                        $this->record->{$key} = $args[$key];
                    }
                }
            } else {
                foreach ($columns as $key) {
                    if (isset($args[$key])) {
                        $this->record->{$key} = $args[$key];
                    }
                }
            }

            $this->record->Replace();
            if ($this->cacheBlockRecord() && Config::get('concrete.cache.blocks')) {
                $record = base64_encode(serialize($this->record));
                $db = Database::connection();
                $db->Execute('update Blocks set btCachedBlockRecord = ? where bID = ?', [$record, $this->bID]);
            }
        }
    }
protected function performSave ( $ args , $ loadExisting = false ) { //$argsMerged = array_merge($_POST, $args); if ( $ this -> btTable ) { $ db = Database :: connection ( ) ; $ columns = $ db -> MetaColumnNames ( $ this -> btTable ) ; $ this -> record = new BlockRecord ( $ this -> btTable ) ; $ this -> record -> bID = $ this -> bID ; if ( $ loadExisting ) { $ this -> record -> Load ( 'bID=' . $ this -> bID ) ; } if ( $ this -> supportSavingNullValues ) { foreach ( $ columns as $ key ) { if ( array_key_exists ( $ key , $ args ) ) { $ this -> record -> { $ key } = $ args [ $ key ] ; } } } else { foreach ( $ columns as $ key ) { if ( isset ( $ args [ $ key ] ) ) { $ this -> record -> { $ key } = $ args [ $ key ] ; } } } $ this -> record -> Replace ( ) ; if ( $ this -> cacheBlockRecord ( ) && Config :: get ( 'concrete.cache.blocks' ) ) { $ record = base64_encode ( serialize ( $ this -> record ) ) ; $ db = Database :: connection ( ) ; $ db -> Execute ( 'update Blocks set btCachedBlockRecord = ? where bID = ?' , [ $ record , $ this -> bID ] ) ; } } }
Persist the block options.

@param array $args An array that contains the block options
@param bool $loadExisting Shall we initialize the record to be saved with the current data?
Persist the block options .