Get pivot data associated with specific instance.

@param RecordInterface $record

@return array
548038
public function getPivot(RecordInterface $record): array
    {
        if (empty($matched = $this->matchOne($record))) {
            return [];
        }

        return $this->pivotData->offsetGet($matched);
    }
132366
protected function transformRecord($record)
    {
        $columnNames = $this->columnManager->getRequestedColumnNames();
        $columnNames->transform(function ($item) use ($record) {
            return $this->getColumnValue($item, $record);
        });

        $datatableParameters = $this->getDatatableParameters($record);

        return array_merge($datatableParameters, $columnNames->toArray());
    }
779207
protected function getResultData(ViewableData $record, $selected = false)
    {
        return [
            'id' => $record->{$this->getIDField()},
            'text' => $record->{$this->getTextField()},
            'formattedResult' => $this->getFormattedResult($record),
            'formattedSelection' => $this->getFormattedSelection($record),
            'selected' => $selected
        ];
    }
1162385
public function toRecords(string $recordClass): array
    {
        $array = [];
        foreach ($this->rows as $row) {
            /**
             * @var $row Row
             */
            $record = Record::instanceRecord($recordClass, $row->toArray());
            $record->setLoaded();
            $array[] = $record;
        }
        return $array;
    }
532479
protected function getReplacements(Record $record)
    {
        $replacements = [];

        foreach ($record->getContext() as $key => $val) {
            if (null === $val || is_scalar($val) || method_exists($val, '__toString')) {
                $replacements['{'.$key.'}'] = $val;
            } elseif (is_object($val)) {
                $replacements['{'.$key.'}'] = '[object '.get_class($val).']';
            } else {
                $replacements['{'.$key.'}'] = '['.gettype($val).']';
            }
        }

        return $replacements;
    }
802658
public static function toScalarValues($record)
    {
        return array_map(
            function ($v) {
                if (!is_scalar($v)) {
                    return '<' . gettype($v) . '>';
                }
                return $v;
            },
            (array)$record
        );
    }
878340
public static function getValues(GedcomRecord $record = null): array
    {
        $values = [];
        foreach (self::TYPES as $type) {
            $values[$type] = self::getValue($type, $record);
        }
        uasort($values, '\Fisharebest\Webtrees\I18N::strcasecmp');

        return $values;
    }
714898
public static function parse($record): Record
    {
        if ($record instanceof Record) {
            return $record;
        }
        if ($record instanceof stdClass) {
            $record = (array)$record;
        }
        if (is_array($record)) {
            return static::make($record);
        }
        $type = gettype($record);
        if ($type === TYPE_OBJECT) {
            $type = get_class($type);
        }
        throw new SimplesRunTimeError("Record must be an array or instanceof Record '{$type}' given");
    }
1276192
public function saveInto(DataObjectInterface $record)
    {
        // Obtain Field Name:
        
        $fieldName = $this->getName();
        
        // Bail Early (if needed):
        
        if (empty($fieldName) || empty($record)) {
            return;
        }
        
        // Obtain Value:
        
        $value = $this->Value();
        
        // Value Not Empty / Does Not Exist?
        
        if (!empty($value) && !in_array($value, $this->getSourceValues())) {
            
            // Create New Object (if enabled):
            
            if ($this->getCanCreate() && $this->dataClass) {
                $object = Injector::inst()->create($this->dataClass, $this->dataDefaults);
                $object->setField($this->getTextField(), $value);
                $this->setValue($object->write());
            }
            
        }
        
        // Call Parent Method:
        
        return parent::saveInto($record);
    }
748724
protected function columnMapRecord($record)
    {
        $adjustedmap = $this->columnMap;
        $newrecord = array();
        foreach ($record as $field => $value) {
            if (isset($adjustedmap[$field])) {
                $newrecord[$adjustedmap[$field]] = $value;
            } else {
                $newrecord[$field] = $value;
            }
        }

        return $newrecord;
    }
913394
protected function primaryColumnOf(RecordInterface $record): string
    {
        return $this->orm->define(get_class($record), ORMInterface::R_PRIMARY_KEY);
    }
774494
public function execute(array $records) : array {
        $idalias = $this->idalias;
        $alias = $this->alias;

        return array_map(function($record) use ($idalias, $alias) {
            return user_picture::unalias($record, null, $idalias, $alias);
        }, $records);
    }
1047193
public function prune($record = null)
    {
        if ($record) {
            $this->addUsingAlias(RecordTableMap::COL_ID, $record->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
690709
protected function getOutputRecord(array $record)
    {
        // Adds the basic log details.
        $output = [
            static::DATETIME_OFFSET => $record['datetime']->format(static::DATETIME_FORMAT),
            static::SEVERITY_OFFSET => $record['level_name'],
            static::CONTENT_OFFSET  => $record['message'],
        ];

        // Adds the context file.
        if (isset($record['context']['file'])) {
            $output[static::FILE_OFFSET] = $record['context']['file'];
        }

        // Adds the context line.
        if (isset($record['context']['line'])) {
            $output[static::LINE_OFFSET] = $record['context']['line'];
        }

        // Adds the stack information.
        if (isset($record['extra'][EnvironmentProcessorAbstract::LOG_STACK])) {
            $output[static::STACK_OFFSET] = $record['extra'][EnvironmentProcessorAbstract::LOG_STACK];
        }

        // Adds the trace information.
        if (isset($record['extra'][BacktraceProcessor::TRACE_OFFSET])) {
            $output[static::TRACE_OFFSET] = $record['extra'][BacktraceProcessor::TRACE_OFFSET];
        }

        return $output;
    }
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;
    }
1373487
private function listRecordMetadata(\record_adapter $record)
    {
        $includeBusiness = $this->getAclForUser()->can_see_business_fields($record->getDatabox());

        return $this->listRecordCaptionFields($record->get_caption()->get_fields(null, $includeBusiness));
    }
54928
protected function getLogRecord($record)
    {
        $prefix = $suffix = array();

        // first infos
        $date = $record['datetime']->format( $this->datetime_format );
        $prefix[] = '['.$date.']';
        if (!empty($record['ip']))
            $prefix[] = '[ip '.$record['ip'].']';
        if (!empty($record['pid']))
            $prefix[] = '[pid '.$record['pid'].']';
        $prefix[] = $record['level_name'].' :';

        // last infos
        if (!empty($record['context'])) {
            $suffix[] = '['.$this->writeArray($record['context']).']';
        }
        if (!empty($record['extra'])) {
            $suffix[] = '['.$this->writeArray($record['extra']).']';
        }

        return join(' ', $prefix).' '.preg_replace("/\n*$/", ' ', $record['message']).' '.join(' ', $suffix);
    }