Reload the tour into the current object.

@param   stdClass    $record     The record to reload.
@param   boolean     $clean      Clean the values.
@return  tour
769044
protected function reload_from_record($record, $clean = false) {
        $this->id           = $record->id;
        if (!property_exists($record, 'description')) {
            if (property_exists($record, 'comment')) {
                $record->description = $record->comment;
                unset($record->comment);
            }
        }
        if ($clean) {
            $this->name         = clean_param($record->name, PARAM_TEXT);
            $this->description  = clean_text($record->description);
        } else {
            $this->name         = $record->name;
            $this->description  = $record->description;
        }
        $this->pathmatch    = $record->pathmatch;
        $this->enabled      = $record->enabled;
        if (isset($record->sortorder)) {
            $this->sortorder = $record->sortorder;
        }
        $this->config       = json_decode($record->configdata);
        $this->dirty        = false;
        $this->steps        = [];

        return $this;
    }
1370393
public function addRecord(Record $l)
    {
        if ($this->collRecords === null) {
            $this->initRecords();
            $this->collRecordsPartial = true;
        }

        if (!$this->collRecords->contains($l)) {
            $this->doAddRecord($l);

            if ($this->recordsScheduledForDeletion and $this->recordsScheduledForDeletion->contains($l)) {
                $this->recordsScheduledForDeletion->remove($this->recordsScheduledForDeletion->search($l));
            }
        }

        return $this;
    }
784005
def reload(options = nil)
      options = (options || {}).merge(no_obfuscated_id: true)

      clear_aggregation_cache
      clear_association_cache

      fresh_object =
        if options && options[:lock]
          self.class.unscoped { self.class.lock(options[:lock]).find(id, options) }
        else
          self.class.unscoped { self.class.find(id, options) }
        end

      @attributes = fresh_object.instance_variable_get('@attributes')
      @new_record = false
      self
    end
981839
protected function getDocument($record)
    {
        $document = new Document();
        $document->setData($record);
        $document->setType($this->type);
        $document->setIndex($this->index);

        return $document;
    }
183570
public function handle( Record $record )
    {
        $this->open( $record );

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

        return $record;
    }
186203
protected static function extract_item_record_from_record(stdClass $record) {
        $newrec = new stdClass();
        foreach ($record as $key => $value) {
            if (strpos($key, 'item') !== 0) {
                continue;
            }
            $key = substr($key, 4);
            $newrec->{$key} = $value;
        }
        return $newrec;
    }
968273
protected static function cleanRecords(
        $records,
        $include = '*',
        $id_field = self::DEFAULT_ID_FIELD,
        $use_doc = false
    ){
        $out = [];

        foreach ($records as $record) {
            if ($use_doc) {
                $record = array_get($record, 'doc', $record);
            }

            $out[] = '*' == $include ? $record : static::cleanRecord($record, $include, static::DEFAULT_ID_FIELD);
        }

        return $out;
    }
32017
protected static function create($record) {
        global $DB;
        if (empty($record->tagcollid)) {
            $record->tagcollid = core_tag_collection::get_default();
        }
        $DB->insert_record('tag_area', array('component' => $record->component,
            'itemtype' => $record->itemtype,
            'tagcollid' => $record->tagcollid,
            'callback' => $record->callback,
            'callbackfile' => $record->callbackfile,
            'showstandard' => isset($record->showstandard) ? $record->showstandard : core_tag_tag::BOTH_STANDARD_AND_NOT,
            'multiplecontexts' => isset($record->multiplecontexts) ? $record->multiplecontexts : 0));

        // Reset cache.
        cache::make('core', 'tags')->delete('tag_area');
    }
296549
protected function preCleanRecords($records)
    {
        $new = [];
        foreach ($records as $record) {
            if (property_exists($record, $this->transactionTable)) {
                $cleaned = (array)$record->{$this->transactionTable};
                unset($cleaned[static::ID_FIELD]);
                if (property_exists($record, '_id')) {
                    $cleaned = array_merge([static::ID_FIELD => $record->_id], $cleaned);
                }
            } else {
                $cleaned = (array)$record;
            }
            $new[] = $cleaned;
        }

        return $new;
    }
777342
public function transformRecordsToObjects($records)
    {
        if ($this->recordClass) {
            $recordClass = $this->recordClass;
            foreach ($records as &$record) {
                $record = (new $recordClass($record));
            }
        }

        return $records;
    }
133504
public function fillRecord(Record $record)
    {
        /**
         * Get record from right entity.
         */
        $rightRecord = $this->getRightRecord(
            $this->getRightEntity(),
            $this->primaryKey,
            $record->{$this->foreignKey}
        );

        /**
         * Set relation.
         */
        $record->setRelation($this->fill, $rightRecord);

        /**
         * Fill relations.
         */
        $this->fillRecordWithRelations($record);
    }
857547
protected function getRecordState($record)
    {
        if ($this->isVersioned()) {
            // Check stage this record belongs to
            $stage = $record->getSourceQueryParam('Versioned.stage') ?: Versioned::get_stage();

            // Non-live stages are automatically non-public
            if ($stage !== Versioned::LIVE) {
                return AssetManipulationList::STATE_PROTECTED;
            }
        }

        // Check if canView permits anonymous viewers
        return Member::actAs(null, function () use ($record) {
            return $record->canView()
                ? AssetManipulationList::STATE_PUBLIC
                : AssetManipulationList::STATE_PROTECTED;
        });
    }
961777
protected static function cleanRecord($record = [], $include = '*', $id_field = self::DEFAULT_ID_FIELD)
    {
        if ('*' == $include) {
            return $record;
        }

        //  Check for $record['_id']
        $id = array_get($record, $id_field,
            //  Default to $record['id'] or null if not found
            array_get($record, 'id')
        );

        //  Check for $record['_rev']
        $rev = array_get($record, static::REV_FIELD,
            //  Default if not found to $record['rev']
            array_get($record, 'rev',
                //  Default if not found to $record['value']['rev']
                array_get($record, 'value.rev')
            )
        );

        $out = [$id_field => $id, static::REV_FIELD => $rev];

        if (empty($include)) {
            return $out;
        }

        if (!is_array($include)) {
            $include = array_map('trim', explode(',', trim($include, ',')));
        }

        foreach ($include as $key) {
            if (0 == strcasecmp($key, $id_field) || 0 == strcasecmp($key, static::REV_FIELD)) {
                continue;
            }
            $out[$key] = array_get($record, $key);
        }

        return $out;
    }
747980
private function doRefresh($entity, array &$visited)
    {
        $oid = spl_object_hash($entity);

        if (isset($visited[$oid])) {
            return; // Prevent infinite recursion
        }

        $visited[$oid] = $entity; // mark visited

        if ($this->getEntityState($entity) !== self::STATE_MANAGED) {
            throw OGMInvalidArgumentException::entityNotManaged($entity);
        }

        $this->getPersister(get_class($entity))->refresh($this->entityIds[$oid], $entity);

        $this->cascadeRefresh($entity, $visited);
    }
1373641
def call(record, reflection:, skip_record:)
      if reflection.collection?
        _reindex_collection(reflection, record, skip_record)
      else
        _reindex_single(reflection, record, skip_record)
      end
    end
1293200
public function reset($key)
    {
        $record = static::findRecord($key);
        if (!$record) {
            return false;
        }

        $record->delete();

        unset(static::$cache[$key]);
        return true;
    }
163658
protected function processChildRecord($record)
    {
        $id = (int)$record['uid'];
        $this->checkOptions($record);
        /* @var $recordContentObjectRenderer ContentObjectRenderer */
        $recordContentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class);
        $recordContentObjectRenderer->start($record, 'tt_content');
        $this->processedRecordVariables[$id] = ['data' => $record];
        if (
            (int)$this->options['recursive'] > 0 &&
            $record['CType'] === 'gridelements_pi1' &&
            !empty($record['tx_gridelements_backend_layout'])
        ) {
            $childProcessorConfiguration = $this->containerProcessorConfiguration;
            $childProcessorConfiguration['dataProcessing.']['0.'] = $this->processorConfiguration;
            $childProcessorConfiguration['dataProcessing.']['0.']['recursive'] = (int)$this->options['recursive'] - 1;
            $childProcessorConfiguration['dataProcessing.']['0'] = 'GridElementsTeam\Gridelements\DataProcessing\GridChildrenProcessor';
            $this->processedRecordVariables[$id] = $this->contentDataProcessor->process(
                $recordContentObjectRenderer,
                $childProcessorConfiguration,
                $this->processedRecordVariables[$id]
            );
        } else {
            $this->processedRecordVariables[$id] = $this->contentDataProcessor->process(
                $recordContentObjectRenderer,
                $this->containerProcessorConfiguration,
                $this->processedRecordVariables[$id]
            );
        }
    }