Save the messages for a given block to the session

@param  string $blockName
@param  array $messages
@return null
510474
public function saveMessages($blockName, $messages) {
        $allMessages = $this->getMessages();
        $allMessages[$blockName] = array_merge(
            $this->loadMessages($blockName), $messages );
        $this->setMessages($allMessages);
    }
1143598
public function push($queueName, Message $message)
    {
        $cache = $this->get($queueName);
        $cache->enqueue($message);
    }
365402
public function save($message = null)
    {
        $this->arguments[] = 'branch';
        if ($message) {
            $this->arguments[] = $message;
        }
        return $this->run();
    }
443835
public function setBlockName($blockName)
    {
        $this->setData('block_name', $blockName);
        $this->append($this->getLayout()->getBlock($blockName));
        return $this;
    }
1039517
public function save($message = null, $includeUntracked = false, $keepIndex = false)
    {
        $this->clearAll();
        $this->addCommandName(self::STASH_COMMAND . ' save');
        if (!is_null($message)) {
            $this->addCommandSubject($message);
        }

        if ($includeUntracked) {
            $this->addCommandArgument('--include-untracked');
        }

        if ($keepIndex) {
            $this->addCommandArgument('--keep-index');
        }

        return $this->getCommand();
    }
324397
protected function saveMessage()
    {
        $this->savedMessage = ['headers' => []];
        $this->savedMessage['body'] = $this->getBody();
        $this->savedMessage['children'] = $this->getChildren();
        if (count($this->savedMessage['children']) > 0 && '' != $this->getBody()) {
            $this->setChildren(array_merge([$this->becomeMimePart()], $this->savedMessage['children']));
            $this->setBody('');
        }
    }
1237069
public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void
    {
        $this->setBlockSetting($block_id, 'show_last_update', $request->get('show_last_update', ''));
        $this->setBlockSetting($block_id, 'show_common_surnames', $request->get('show_common_surnames', ''));
        $this->setBlockSetting($block_id, 'number_of_surnames', $request->get('number_of_surnames', self::DEFAULT_NUMBER_OF_SURNAMES));
        $this->setBlockSetting($block_id, 'stat_indi', $request->get('stat_indi', ''));
        $this->setBlockSetting($block_id, 'stat_fam', $request->get('stat_fam', ''));
        $this->setBlockSetting($block_id, 'stat_sour', $request->get('stat_sour', ''));
        $this->setBlockSetting($block_id, 'stat_other', $request->get('stat_other', ''));
        $this->setBlockSetting($block_id, 'stat_media', $request->get('stat_media', ''));
        $this->setBlockSetting($block_id, 'stat_repo', $request->get('stat_repo', ''));
        $this->setBlockSetting($block_id, 'stat_surname', $request->get('stat_surname', ''));
        $this->setBlockSetting($block_id, 'stat_events', $request->get('stat_events', ''));
        $this->setBlockSetting($block_id, 'stat_users', $request->get('stat_users', ''));
        $this->setBlockSetting($block_id, 'stat_first_birth', $request->get('stat_first_birth', ''));
        $this->setBlockSetting($block_id, 'stat_last_birth', $request->get('stat_last_birth', ''));
        $this->setBlockSetting($block_id, 'stat_first_death', $request->get('stat_first_death', ''));
        $this->setBlockSetting($block_id, 'stat_last_death', $request->get('stat_last_death', ''));
        $this->setBlockSetting($block_id, 'stat_long_life', $request->get('stat_long_life', ''));
        $this->setBlockSetting($block_id, 'stat_avg_life', $request->get('stat_avg_life', ''));
        $this->setBlockSetting($block_id, 'stat_most_chil', $request->get('stat_most_chil', ''));
        $this->setBlockSetting($block_id, 'stat_avg_chil', $request->get('stat_avg_chil', ''));
    }
1326450
private function saveValues(array $values, $prefix, SessionInterface $session)
    {
        foreach ($values as $name => $value) {
            $session->set($prefix . $name, $value);
        }
    }
881550
public function log($messages)
    {
        if (!is_array($messages)) {
            $messages = [$messages];
        }
        foreach ($messages as $message) {
            file_put_contents($this->logFile, date('d.m.Y H:i:s') . ' - ' . $message . PHP_EOL, FILE_APPEND | LOCK_EX);
        }
    }
1105213
public function setMessages(array $messages, $language) {
		$messageFile = $this->getMessageLanguageForLanguage($language);
		$messageFile->setMessages($messages);
		$messageFile->save();
	}
10159
public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void
    {
        $this->setBlockSetting($block_id, 'num', $request->get('num', self::DEFAULT_NUMBER));
        $this->setBlockSetting($block_id, 'infoStyle', $request->get('infoStyle', self::DEFAULT_STYLE));
    }
902796
public function blockJson($blockName, $options = [])
    {
        if (array_key_exists('returnAll', $options) && $options['returnAll']) {
            unset($options['returnAll']);
            $blocksData = [];
            $themeId = ($theme = Theme::where('theme', '=', $this->theme)->first()) ? $theme->id : 0;
            $template = Template::preload($this->template);
            $categoryBlocks = ThemeTemplate::templateBlocks($themeId, $template->exists ? $template->id : null);
            foreach ($categoryBlocks as $blockCategory => $blocks) {
                foreach ($blocks as $block) {
                    $blocksData += json_decode($this->blockJson($block->name, $options), true);
                }
            }
            return collect($blocksData)->toJson();
        }
        return $this->_block($blockName, $options, 'toJson');
    }
503895
public function block($messages, $type = 'error')
    {
        $output = [];
        if (!is_array($messages)) {
            $messages = (array) $messages;
        }
        foreach ($messages as $message) {
            $output[] = trim($message);
        }
        $formatter = new FormatterHelper();
        $this->line($formatter->formatBlock($output, $type, true));
    }
525286
public function includeBlock($blockName)
    {
        $blockName = str_replace('/', DIRECTORY_SEPARATOR, $blockName);
        $blockContent = '';
        $blockFile = BASE_PATH . DIRECTORY_SEPARATOR . 'storage' . DIRECTORY_SEPARATOR . 'share' . DIRECTORY_SEPARATOR . 'layout' . DIRECTORY_SEPARATOR . $blockName . '.' . $this->config['templateExtension'];

        if (file_exists($blockFile)) {
            $templateTmp = file_get_contents($blockFile);
            preg_match_all("~\{\{\s*(.*?)\s*\}\}~", $templateTmp, $block);
            foreach ($block[1] as $k => $v) {
                if ($v === 'php') {
                    $templateTmp = str_replace('{{php}}', '<?php', $templateTmp);
                } elseif ($v === '/php') {
                    $templateTmp = str_replace('{{/php}}', '?>', $templateTmp);
                } else {
                    $blockTemplate = $this->includeBlock($v);
                    $templateTmp = str_replace('{{' . $v . '}}', $blockTemplate, $templateTmp);
                }
            }
            $blockContent = $templateTmp;
        } else {
            $blockContent = 'FILE NOT FOUND (' . $blockFile . ')';
        }
        return $blockContent;
    }
1135155
public function save(array $rules = array(),
        array $customMessages = array(),
        array $options = array(),
        Closure $beforeSave = null,
        Closure $afterSave = null
    ) {
        return $this->internalSave($rules, $customMessages, $options, $beforeSave, $afterSave, false);
    }
346512
protected function saveBlock($fullClassName)
    {
        // ensure all classes start with trailing slash class name definition like `\foo\bar\Class`
        $fullClassName = '\\'  . ltrim($fullClassName, '\\');
        $model = Block::find()->where(['class' => $fullClassName])->one();
        
        $blockObject = $this->createBlockObject($fullClassName);
        
        $blockGroupId = $this->getBlockGroupId($blockObject);
        
        if (!in_array($blockGroupId, $this->blockGroupIds)) {
            $this->blockGroupIds[] = $blockGroupId;
        }
        
        $log = "block {$fullClassName}: ";
        if (!$model) {
            $model = new Block();
            $model->group_id = $blockGroupId;
            $model->class = $fullClassName;
            if ($model->save()) {
                $log .= "Added to database";
            } else {
                $log .= "Error while saving";
            }
        } elseif ($model->group_id != $blockGroupId) {
            $log .= 'Updated group id"';
            $model->updateAttributes(['group_id' => $blockGroupId]);
        } else {
            $log .= 'remains the same, nothing to update';
        }
        $this->addLog($log);
        
        return $model->id;
    }
429093
function group( $blockName )
    {
        if ( !isset( $this->BlockValues[$blockName] ) )
        {
            eZDebug::writeError( "Unknown group: '$blockName'", __METHOD__ );
            $ret = null;
            return $ret;
        }
        if ( isset( self::$injectedSettings[$this->FileName][$blockName] ) )
        {
            $ret = array_merge(
                $this->BlockValues[$blockName],
                self::$injectedSettings[$this->FileName][$blockName]
            );
        }
        else
        {
            $ret = $this->BlockValues[$blockName];
        }

        return $ret;
    }