You are here

public function BlockEditor::update in Forena Reports 7.5

Same name and namespace in other branches
  1. 8 src/Editor/BlockEditor.php \Drupal\forena\Editor\BlockEditor::update()

Update the block data.

Parameters

unknown $block:

Return value

BlockEditor

2 calls to BlockEditor::update()
BlockEditor::load in src/Editor/BlockEditor.php
Block loader method.
BlockEditor::rename in src/Editor/BlockEditor.php
Rename the exisiting block.

File

src/Editor/BlockEditor.php, line 63

Class

BlockEditor

Namespace

Drupal\forena\Editor

Code

public function update($block = array()) {
  if ($block) {

    // Make sure we don't put any invalid values
    $block = array_intersect_key($block, $this->block);
    $block = array_merge($this->block, $block);
    $same = $block['file'] == $this->block['file'] && @$block['access'] == @$this->block['access'];

    // UPdate the block;
    if (!$same) {
      $this->block = $block;
      $_SESSION['forena_query_editor'][$this->block_name] = $this->block;
      $this->modified = TRUE;
    }
  }
  return $this;
}