Build a Response object starting from a cached page.

@param \Concrete\Core\Cache\Page\PageCacheRecord $record the cache record containing the cached page data

@return \Concrete\Core\Http\Response
775056
public function deliver(PageCacheRecord $record)
    {
        $response = new Response();
        $headers = [];
        if (defined('APP_CHARSET')) {
            $headers['Content-Type'] = 'text/html; charset=' . APP_CHARSET;
        }
        $headers = array_merge($headers, $record->getCacheRecordHeaders());

        $response->headers->add($headers);
        $response->setContent($record->getCacheRecordContent());

        return $response;
    }
64861
public static function load_from_record($record, $clean = false) {
        $tour = new self();
        return $tour->reload_from_record($record, $clean);
    }
656087
protected function processRecord(Record $record)
    {

        foreach ($this->processors as $processor) {
            if ($this->isInstanceOf($processor, ProcessorInterface::class)) {
                $processor->processRecord($record);
            } else {
                call_user_func($processor, $record);
            }
        }
    }
314560
protected function buildContent($record)
    {
        if (strlen($record['formatted']) > $this->limit) {
            $record['formatted'] = substr($record['formatted'], 0, $this->limit);
        }

        $dataArray = [
            'content' => $record['formatted'],
            'to' => (!is_array($this->toNumber)? [$this->toNumber] : $this->toNumber)
        ];

        ($this->fromNumber)? $dataArray['from'] = $this->fromNumber : false;

        return json_encode($dataArray);
    }
1145518
protected function canEditState($record)
	{
		$user = JFactory::getUser();

		// Check for existing category.
		if (!empty($record->id))
		{
			return $user->authorise('core.edit.state', $record->extension . '.category.' . (int) $record->id);
		}

		// New category, so check against the parent.
		if (!empty($record->parent_id))
		{
			return $user->authorise('core.edit.state', $record->extension . '.category.' . (int) $record->parent_id);
		}

		// Default to component settings if neither category nor parent known.
		return $user->authorise('core.edit.state', $record->extension);
	}
922296
protected function getRecordUpdatedResponse($record, $form)
    {
        // Return the record data in the same response as the schema to save a postback
        $schemaData = ['record' => $this->getObjectFromData($record)];
        $schemaId = Controller::join_links($this->Link('schema/fileEditForm'), $record->ID);
        return $this->getSchemaResponse($schemaId, $form, null, $schemaData);
    }
13210
protected function reload_from_record($record, $clean = false) {
        $this->id           = $record->id;
        $this->tourid       = $record->tourid;
        if ($clean) {
            $this->title    = clean_param($record->title, PARAM_TEXT);
            $this->content  = clean_text($record->content);
        } else {
            $this->title    = $record->title;
            $this->content  = $record->content;
        }
        $this->targettype   = $record->targettype;
        $this->targetvalue  = $record->targetvalue;
        $this->sortorder    = $record->sortorder;
        $this->config       = json_decode($record->configdata);
        $this->dirty        = false;

        return $this;
    }
361386
public function getRecordOnClick($record)
    {
        if (!isset($this->recordOnClick)) {
            return null;
        }

        $recordOnClick = RouterHelper::replaceParameters($record, $this->recordOnClick);
        return Html::attributes(['onclick' => $recordOnClick]);
    }
183570
public function handle( Record $record )
    {
        $this->open( $record );

        if ($this->recordFormatter->formatRecord( $this->writer, $record )) {
            $this->incrementRecordCount();
        }

        return $record;
    }
539591
protected static function extract_object_from_record($record, $prefix, $additionalfields = []) {
        $object = new \stdClass();
        foreach ($record as $key => $value) {
            if (preg_match('/^'.preg_quote($prefix, '/').'(.*)/', $key, $matches)) {
                $object->{$matches[1]} = $value;
            }
        }
        if ($additionalfields) {
            foreach ($additionalfields as $key => $value) {
                $object->$key = $value;
            }
        }
        return $object;
    }
1112274
public function format(array $record)
    {
        $this->addRow($record['level_name'], $record['level']);
        $this->addRow('Message', (string) $record['message']);
        $this->addRow('Time', $record['datetime']->format($this->dateFormat));
        $this->addRow('Channel', $record['channel']);

        if (isset($record['context']['file'])) {
            $this->addRow('File', $record['context']['file']);
            $this->addRow('Line', $record['context']['line']);
        }

        if (isset($record['context']['exception'])) {
            $trace = explode(PHP_EOL, $record['context']['exception']->getTraceAsString());
            $this->addRow('Trace', array_shift($trace));
            foreach ($trace as $row) {
                $this->addRow('', $row);
            }
        }

        return $this->render($this->getColoursByLogLevel($record['level']));
    }
422111
public function pushRecord(Record $record)
    {
        $this->records[] = $record;

        if (!$record->getType()->isStdin() || $record->getContent()) {
            return;
        }

        return $this->buildRequest();
    }
55096
public function processRecord(array $record)
    {
        $request = $this->requestStack->getCurrentRequest();

        $record['extra']['user_ip'] = '0.0.0.0';
        if (null !== $request) {
            $record['extra']['user_ip'] = $request->getClientIp();
            $record['extra']['user_name'] = $this->securityContext->getToken()->getUsername();
        }

        $record['extra']['site_name'] = $this->context->getSiteName();
        $record['extra']['site_id'] = $this->context->getSiteId();

        return $record;
    }
1228958
public function handle( IRecord $record )
    {
        // check if we should be logging this record
        if ( $record->getLevel() >= $this->_level )
        {
            $this->_mailer->isHtml( TRUE );
            $this->_mailer->setSubject( $record->getTitle() );

            $content = $this->getFormatter()->format( $record );

            $this->_mailer->setBody( $content );

            $this->_mailer->send();
        }
    }
206857
protected function addRecord(array $record)
    {
        return $this->document->fputcsv($record, $this->delimiter, $this->enclosure, $this->escape);
    }
673035
public static function set_contextlevel($record) {
        global $DB;

        if ($record->contextlevel != CONTEXT_SYSTEM && $record->contextlevel != CONTEXT_USER) {
            throw new \coding_exception('Only context system and context user can set a contextlevel ' .
                'purpose and retention');
        }

        if ($contextlevel = contextlevel::get_record_by_contextlevel($record->contextlevel, false)) {
            // Update.
            $contextlevel->from_record($record);
        } else {
            // Add.
            $contextlevel = new contextlevel(0, $record);
        }
        $contextlevel->save();

        // We sync with their defaults as we removed these options from the defaults page.
        $classname = \context_helper::get_class_for_level($record->contextlevel);
        list($purposevar, $categoryvar) = data_registry::var_names_from_context($classname);
        set_config($purposevar, $record->purposeid, 'tool_dataprivacy');
        set_config($categoryvar, $record->categoryid, 'tool_dataprivacy');

        return $contextlevel;
    }
170558
private function fetchRecordId(string $zoneId, Record $record)
    {
        $response = $this->dns->list_records($zoneId, $record->getType(), $this->getNormalisedRecordName($record));
        $this->checkResponse($response);

        return $response->result[0]->id ?? null;
    }