@param  Record $record

@return  Record|null
183570
public function handle( Record $record )
    {
        $this->open( $record );

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

        return $record;
    }
901079
protected static function createFromRecord($record)
    {
        if (is_array($record) && $record['cnvEditorHandle']) {
            /** @var \Concrete\Core\Utility\Service\Text $textHelper */
            $textHelper = Core::make('helper/text');
            $class = '\\Concrete\\Core\\Conversation\\Editor\\' . $textHelper->camelcase(
                    $record['cnvEditorHandle']
                ) . 'Editor';
            /** @var Editor $sc Really this could be any kind of editor but this should help code completion a bit */
            $sc = Core::make($class);
            $sc->setPropertiesFromArray($record);

            return $sc;
        }

        return null;
    }
314661
public function setRecord($record) {
    $this->resetObject();
    $newRecord = array();
    foreach ($this->fields as $field_name => $field) {
      if (!empty($record[$field_name])) {
        $newRecord[$field_name] = $record[$field_name];
      }
      else {
        $newRecord[$field_name] = ''; //Adds the field but with empty string.
      }
    }
    $this->record = $newRecord;
    $this->fetchedRecord = $record;

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

        $recordOnClick = RouterHelper::replaceParameters($record, $this->recordOnClick);
        return Html::attributes(['onclick' => $recordOnClick]);
    }
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);
            }
        }
    }
233676
protected function assertCondition($record, $condition)
    {
        $left = $condition[0];
        $op = $condition[1];
        $right = $condition[2];

        switch ($op) {
            case '=':
                $value = $this->getRecordField($record, $left);
                return $value == $right;

            case '==':
                $value = $this->getRecordField($record, $left);
                return $value === $right;

            case '!=':
                $value = $this->getRecordField($record, $left);
                return $value != $right;

            case '!==':
                $value = $this->getRecordField($record, $left);
                return $value !== $right;

            case '<':
                $value = $this->getRecordField($record, $left);
                return $value < $right;

            case '>':
                $value = $this->getRecordField($record, $left);
                return $value > $right;

            default:
                throw new Exception('Operator ['.$op.'] is not supported');
        }
    }
452505
public function getTranslatableForeignKeys(Record $record)
    {
        return [
            $this->primaryKey                => $record->{$this->primaryKey},
            $this->translatableLanguageField => $this->translatableLang->langId(),
        ];
    }
4628
protected static function handler_from_record($record) {
        $classname = $record->classname;
        if (strpos($classname, '\\') !== 0) {
            $classname = '\\' . $classname;
        }
        if (!class_exists($classname)) {
            return false;
        }

        $handler = new $classname;
        if (isset($record->id)) {
            $handler->set_id($record->id);
        }
        $handler->set_component($record->component);

        // Overload fields which can be modified.
        if (isset($record->defaultexpiration)) {
            $handler->set_defaultexpiration($record->defaultexpiration);
        }

        if (isset($record->validateaddress)) {
            $handler->set_validateaddress($record->validateaddress);
        }

        if (isset($record->enabled)) {
            $handler->set_enabled($record->enabled);
        }

        return $handler;
    }
516911
protected function removeRecord (Record $record) 
    {
        $index = array_search($record, $this->_records, true);
        if ($index === false) {
            throw new InvalidArgumentException("{$this} does not contain {$record}");
        }
        unset($this->_records[$index]);
    }
1068652
protected function map(array $record)
    {
        $mapping = $this->getMapping();

        if (count($mapping) > 0) {
            $result = [];

            foreach ($mapping as $columnId => $data) {
                if (!empty($data[0])) {
                    if (!isset($result[$data[0]])) {
                        $result[$data[0]] = [];
                    }
                    $result[$data[0]][$data[1]] = $record[$columnId];
                } else {
                    $result[$data[1]] = $record[$columnId];
                }
            }

            return $result;
        } else {
            return $record;
        }
    }
715390
public function remove(Record $record): void
    {
        //本结果集的表主键
        $primaryKey = $this->primaryKey;

        //要删除的主键值
        $deleted = [];

        //根据参数类型判断
        if ($record instanceof Record or $record instanceof Row) {
            //行对象类型
            $deleted[] = $record->$primaryKey;
        } elseif (!is_array($record)) {
            //简单类型
            $deleted[] = $record;
        } else {
            //数组,要逐个删除
            foreach ($record as $k => $r) {
                if ($r instanceof Record or $r instanceof Row) {
                    $deleted[] = $r->$primaryKey;
                } elseif (!is_array($r)) {
                    $deleted[] = $r;
                } else {
                    trigger_error('要移除的记录无法识别:' . json($r), E_USER_ERROR);
                }
            }
        }

        //在结果集中看是否需要删除
        foreach ($this->rows as $key => $row) {
            if (in_array($row->{$this->primaryKey}, $deleted)) {
                unset($this->rows[$key]);
            }
        }
    }
981839
protected function getDocument($record)
    {
        $document = new Document();
        $document->setData($record);
        $document->setType($this->type);
        $document->setIndex($this->index);

        return $document;
    }
743168
protected function processRecord(array $record): array
    {
        if ($this->processors) {
            foreach ($this->processors as $processor) {
                $record = PhpHelper::call($processor, $record);
            }
        }

        return $record;
    }
768108
public static function insert($table, $record)
    {
        if(empty($record)) return null;

        $query = array("INSERT INTO $table");
        array_push($query, ' ('.implode(', ', array_keys($record)).')');
        array_push(
            $query,
            ' VALUES (' .
            implode(', ', array_fill(0, count($record), '?'))
            . ')'
        );
        return implode($query);
    }
310268
public function fillRecordWithRelations(Record $record)
    {
        foreach ($this->getWith() as $relation) {
            $relation->fillRecord($record);
        }

        return $record;
    }
699786
public function toRecord(string $recordClass): Record
    {
        $record = Record::instanceRecord($recordClass, $this->data);
        $record->setLoaded();
        return $record;
    }
1277085
protected static function create_instance_from_record(stdClass $record) {
        $classname = context_helper::get_class_for_level($record->contextlevel);

        if ($context = context::cache_get_by_id($record->id)) {
            return $context;
        }

        $context = new $classname($record);
        context::cache_add($context);

        return $context;
    }