Load properties of this class from db record.

@param object $record Given a record from 'question_statistics' copy stats from record to properties.
166884
public function populate_from_record($record) {
        foreach ($this->fieldsindb as $field) {
            $this->$field = $record->$field;
        }
        $this->timemodified = $record->timemodified;
    }
1356917
public function __getTranslatableExtension(Record $record, $key)
    {
        /**
         * Check that translatable field exists in database.
         */
        if (!$this->getRepository()->getCache()->tableHasField(
            $this->getTable() . $this->getTranslatableTableSuffix(),
            $key
        )
        ) {
            return null;
        }

        if (!$record->relationExists('_translations')) {
            /**
             * Fetch translations.
             */
            $record->withTranslations();
        }

        /**
         * Translations were fetched by join.
         */
        foreach ($record->getRelation('_translations') as $translation) {
            if ($translation->keyExists($key)) {
                return $translation->{$key};
            }
        }
    }
818395
public function pushRecord(Record $record)
    {
        switch (true) {
            case $record->getType()->isStdout():
                $this->stdout .= $record->getContent();
                break;
            case $record->getType()->isStderr():
                $this->stderr .= $record->getContent();
                break;
            case $record->getType()->isEndRequest():
                return new Response($this->requestId, new StringReader($this->stdout), new StringReader($this->stderr));
                break;
            default:
                throw new \RuntimeException(sprintf('Unknown package type \'%d\'', $record->getType()));
                break;
        }
    }
498821
private function addBulkDeleteRecord($record)
    {
        if ($this->bulkDeleteLimit === count($this->bulkDeleteRecords)) {
            $this->flushDeletes();
        }

        $this->bulkDeleteRecords[] = $record;
    }
191675
public function processRecord(Record $record)
    {

        $backtrace = debug_backtrace();
        $backtrace = $backtrace[5];

        $extraData = $record->getExtra();

        $extraData['file'] = $backtrace['file'];
        $extraData['line'] = $backtrace['line'];

        $record->setExtra($extraData);
    }
1189285
protected static function doesRecordContainModifier($record)
    {
        if (is_array($record)) {
            foreach ($record as $key => $value) {
                if (!empty($key) && ('$' == $key[0])) {
                    return true;
                }
            }
        }

        return false;
    }
234497
protected function loadData()
    {
        $this->loaded = true;

        $innerKey = $this->key(Record::INNER_KEY);
        if (empty($this->parent->getField($innerKey))) {
            //Unable to load
            return;
        }

        $selector = $this->orm->selector($this->getClass());
        $decorator = new AliasDecorator($selector, 'where', $selector->getAlias());
        $decorator->where($this->whereStatement());

        $this->data = $selector->fetchData();

        if (!empty($this->data[0])) {
            //Use first result
            $this->data = $this->data[0];
        }
    }
268665
public static function adhoc_task_from_record($record) {
        $classname = self::get_canonical_class_name($record->classname);
        if (!class_exists($classname)) {
            debugging("Failed to load task: " . $classname, DEBUG_DEVELOPER);
            return false;
        }
        $task = new $classname;
        if (isset($record->nextruntime)) {
            $task->set_next_run_time($record->nextruntime);
        }
        if (isset($record->id)) {
            $task->set_id($record->id);
        }
        if (isset($record->component)) {
            $task->set_component($record->component);
        }
        $task->set_blocking(!empty($record->blocking));
        if (isset($record->faildelay)) {
            $task->set_fail_delay($record->faildelay);
        }
        if (isset($record->customdata)) {
            $task->set_custom_data_as_string($record->customdata);
        }

        if (isset($record->userid)) {
            $task->set_userid($record->userid);
        }

        return $task;
    }
169428
public static function load_from_record($row) {
        return new question_hint_ddmarker($row->id, $row->hint, $row->hintformat,
                $row->shownumcorrect, $row->clearwrong, $row->options);
    }
1015742
public function transformRecordToEntities(Record $record)
    {
        if (get_class($record) == $this->record) {
            return $record;
        }

        $newRecord = $this->getRecord();
        $newRecord->setData($record->data());
        $newRecord->setOriginalFromData();

        if ($record->isSaved()) {
            $newRecord->setSaved();
        }

        return $newRecord;
    }
122687
private function loadResults($my_std_class)
    {
        if(property_exists($my_std_class->table,'row'))
        {
            foreach ($my_std_class->table->row as $row)
            {
                $this->result->push($this->convertToStdClass($row));
            }
        }

    }
422111
public function pushRecord(Record $record)
    {
        $this->records[] = $record;

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

        return $this->buildRequest();
    }
687286
public static function insert($record)
    {
        $instance = new static();
        if ($fields = array_diff(array_keys($record), $instance->_di->modelsMetadata->getAttributes($instance))) {
            $instance->logger->debug(['insert `:1` table skip fields: :2', $instance->getSource(), array_values($fields)]);

            foreach ($fields as $field) {
                unset($record[$field]);
            }
        }

        $instance->getConnection($record)->insert($instance->getSource($record), $record);

        return 1;
    }
1070210
protected function purgePrimaryKeyValue(&$record)
    {
        foreach((array) $this->ORMParameters['primaryKey'] as $field) {
            if(is_array($record) && (isset($record[$field]) || $record[$field] === null)) {
                unset($record[$field]);
            } elseif(is_object($record) && isset($record->$field) ) {
                unset($record->$field);
            }
        }
    }
823157
protected function write(Record $record)
    {
        $this->room->send(
            $this->getFormattedMessage($record),
            $this->from,
            $this->getLevelColor($record->getLevel()->getValue())
        );
    }
820902
public static function populateRecord($record, $row)
    {
        $dynCol = static::dynamicColumn();
        if (isset($row[$dynCol])) {
            $record->_dynamicAttributes = static::dynColDecode($row[$dynCol]);
        }
        parent::populateRecord($record, $row);
    }
153303
protected function loadProperties()
    {
        $methods = get_class_methods($this);

        foreach ($methods as $method) {
            preg_match("/load[a-zA-Z]+Property/", $method, $matches);

            if (count($matches)) {
                $this->$method();
            }
        }
    }