@param Record $record

@return RequestInterface|null
422111
public function pushRecord(Record $record)
    {
        $this->records[] = $record;

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

        return $this->buildRequest();
    }
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;
  }
723507
public function filter(\Plop\RecordInterface $record)
    {
        foreach ($this->items as $filter) {
            if (!$filter->filter($record)) {
                return false;
            }
        }
        return true;
    }
524547
protected function write(array $record)
    {
    	$uri = $this->getUri();

    	if (empty($uri)) {
    		return;
    	}

    	$request = $this->getMessageFactory()->createRequest(
    		$this->getMethod(),
    		$this->getUri(),
    		$this->getHeaders(),
    		$record['formatted'],
    		$this->getProtocolVersion()
    	);

    	try {
    		$this->getHttpClient()->sendRequest($request);
    	/* istanbul ignore next */
    	} catch (\Exception $e) {
    		// QUESTION(msschl): How to handle the thrown exceptions???
    		/* istanbul ignore next */
    		return;
    	}
    }
1137415
protected function getIsGarbageRecord($table, $record):bool
    {
        return $this->tcaService->isHidden($table, $record) ||
                $this->isInvisibleByStartOrEndtime($table, $record) ||
                $this->hasFrontendGroupsRemoved($table, $record) ||
                ($table === 'pages' && $this->isPageExcludedFromSearch($record)) ||
                ($table === 'pages' && !$this->isIndexablePageType($record));
    }
1334317
protected static function _getRecordClass($record)
    {
        $static = get_called_class();

        if (!static::fieldExists('Class')) {
            return $static;
        }

        $columnName = static::_cn('Class');

        if (!empty($record[$columnName]) && is_subclass_of($record[$columnName], $static)) {
            return $record[$columnName];
        } else {
            return $static;
        }
    }
183570
public function handle( Record $record )
    {
        $this->open( $record );

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

        return $record;
    }
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};
            }
        }
    }
807905
protected function cleanup($record)
    {
        // Translate Throwable (Exception || Error) object into simple array
        if ($this->convertThrowable && $record instanceof Throwable) {
            $record = [
                'message'  => $record->getMessage(),
                'line'     => $record->getLine(),
                'file'     => $record->getFile(),
                'class'    => get_class($record),
                'code'     => $record->getCode(),
                'trace'    => $record->getTrace(),
                'previous' => $record->getPrevious(),
            ];
        }

        // Translate Traversable object into simple array
        if ($this->convertTraversable && $record instanceof Traversable) {
            $record = (array)$record;
        }

        // Traverse over array
        if (is_array($record)) {
            $clean = [];
            foreach ($record as $key => $value) {
                // Remove elements with null value
                if ($this->removeNull && is_null($value)) {
                    unset($clean[$key]);
                    continue;
                }
                $clean[$key] = $this->cleanup($value);
            }

            return $clean;
        }

        // Strip unwanted strings from simple scalar values
        if ($this->stripTags && is_scalar($record)) {
            return str_replace($this->stripTags, '', $record);
        }

        // Return original value if not scalar or array
        return $record;
    }
891766
public function processRecord(array $record)
    {
        if (is_null($this->requestId)) {
            $this->requestId = uniqid('');
        }

        $record['extra']['requestId'] = $this->requestId;

        return $record;
    }
443825
public function retrieve($record)
    {
        $params['index'] = $this->getName();
        $params['type'] = $record['type'];
        $params['id'] = $record['id'];

        self::getClient()->get($params);
    }
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;
    }
498951
public function validate($record)
    {
        $record->errors()->clear();
        
        foreach ($this->validations as $attribute => $validators) {
            if ($attribute === 'validateWith') {
                foreach ($validators as $validatorClass => $options) {
                    if (is_int($validatorClass)) {
                        $validatorClass = $options;
                        $options = [];
                    }
                    $validator = new $validatorClass($options);
                    $validator->validate($record);
                }
            } elseif (is_int($attribute)) {
                if (is_string($validators)) {
                    $record->$validators();
                } elseif (is_array($validators)) {
                    $attributes = array_shift($validators);
                    $validators = array_shift($validators);
                    foreach ($attributes as $attribute) {
                        $this->validateAttribute($record, $attribute, $validators);
                    }
                }
            } else  {
                $this->validateAttribute($record, $attribute, $validators);
            }
        }
        
        return $record->errors()->none();
    }
1044711
protected static function toMongoObjects($record)
    {
        if (!empty($record)) {
            foreach ($record as $key => $data) {
                if (!is_object($data)) {
                    if (is_string($data) && (static::DEFAULT_ID_FIELD == $key)) {
                        $record[$key] = static::idToMongoId($data);
                    } elseif (is_array($data)) {
                        if (1 === count($data)) {
                            // using typed definition, i.e. {"$date" : "2014-08-02T08:40:12.569Z" }
                            if (array_key_exists('$date', $data)) {
                                $temp = $data['$date'];
                                if (empty($temp)) {
                                    // empty means create with current time
                                    $record[$key] = new UTCDateTime(time() * 1000);
                                } elseif (is_string($temp)) {
                                    $record[$key] = new UTCDateTime(strtotime($temp) * 1000);
                                } elseif (is_int($temp)) {
                                    $record[$key] = new UTCDateTime($temp * 1000);
                                }
                            } elseif (isset($data['$id'])) {
                                $record[$key] = static::idToMongoId($data['$id']);
                            } elseif (isset($data['$oid'])) {
                                $record[$key] = static::idToMongoId($data['$oid']);
                            } else {
                                $record[$key] = static::toMongoObjects($data);
                            }
                        }
                    }
                }
            }
        }

        return $record;
    }
837574
protected function getPopoverMenu($record)
    {
        // Build popover actions
        $popoverActions = $this->getPopoverActions($record);
        if ($popoverActions) {
            return PopoverField::create($popoverActions)
                ->setPlacement('top')
                ->setName('PopoverActions')
                ->setButtonTooltip(_t(
                    'SilverStripe\\AssetAdmin\\Forms\\FileFormFactory.OTHER_ACTIONS',
                    'Other actions'
                ));
        }
        return null;
    }
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());
    }
115861
public function stream_handler_for_record( array $record ) {

		list( $filename, $file_permissions ) = $this->file_name_for_record( $record );

		if ( isset( $this->handlers[ $filename ] ) ) {
			return $this->handlers[ $filename ];
		}

		$this->close();

		$handler = new StreamHandler(
			$filename,
			$this->getLevel(),
			$this->getBubble(),
			$file_permissions,
			$this->locking
		);

		$this->handlers[ $filename ] = $handler;

		return $handler;
	}