@param array $resourceRecords

@return Message
500891
public function setAdditionals(array $resourceRecords): Message
    {
        $this->additionals = $resourceRecords;
        $this->header->setAdditionalRecordsCount(count($this->additionals));

        return $this;
    }
1371592
protected static function inLineArray(array $records)
    {

        $values = [];

        foreach ($records as $record)
            $values = array_merge($values, array_values($record));

        return $values;
    }
1206346
protected function setOnResource(array $methods)
    {
        if ( count($methods) <= 2
            && array_filter($methods, function($item) { return is_callable($item); }) 
        )
            ##! 'on_resource' => ['dump_debug' => function($resource) {k($resource);}]
            $methods = array($methods);

        foreach($methods as $method) {
            $name = null;
            if (is_array($method)) {
                if (count($method) === 2) {
                    ##! ['method_name', \Closure]
                    $name = $method[0]; $fn = $method[1];
                } elseif (array_values($method) !== $method) {
                    ##! ['method_name' => \Closure]
                    $name = key($method);
                    $fn = current($method);
                }
            }

            if ($name === null)
                throw new \InvalidArgumentException(
                    'Unknown Method Type Provided For '.\Poirot\Std\flatten($method)
                );

            $this->onResourceAvailable()->addMethod($name, $fn);
        }
    }
1174450
private function processClass(\ArrayIterator $iterator, ResourceRecord $resourceRecord): void
    {
        if (Classes::isValid(strtoupper($iterator->current()))) {
            $resourceRecord->setClass(strtoupper($iterator->current()));
            $iterator->next();
        }
    }
291417
protected function processLegacyZone(array $zones): array
    {
        $resourceRecords = [];
        foreach ($zones as $domain => $types) {
            $domain = rtrim($domain, '.').'.';
            foreach ($types as $type => $data) {
                $data = (array) $data;
                $type = RecordTypeEnum::getTypeFromName($type);
                foreach ($data as $rdata) {
                    $resourceRecords[] = (new ResourceRecord())
                        ->setName($domain)
                        ->setType($type)
                        ->setClass($this->defaultClass)
                        ->setTtl($this->defaultTtl)
                        ->setRdata($rdata);
                }
            }
        }

        return $resourceRecords;
    }
315616
public function saveRecords(array $records, DataDimensions $dataDimensions = null)
    {

        if (!$dataDimensions) {
            $dataDimensions = $this->getCurrentDataDimensions();
        }

        $recordIds = [];
        foreach ($records as $record) {
            $recordIds[] = $this->saveRecord($record, $dataDimensions);
        }

        return $recordIds;

    }
1372299
private function transformRecords(RecordCollection $records, array $transformers, $context)
    {
        foreach ($transformers as $transformer) {
            if ($transformer instanceof PorterAware) {
                $transformer->setPorter($this);
            }

            $records = $transformer->transform($records, $context);
        }

        return $records;
    }
498902
protected function exportRecord(AbstractRecord $record, DataDimensions $dataDimensions)
    {
        $precalculate      = $this->precalculateExportRecord($record, $dataDimensions);
        $allowedProperties = array_intersect_key($record->getProperties(), $precalculate['allowedProperties']);
        $record            = clone $record;
        $record->setProperties($allowedProperties);

        return $record;
    }
899267
public function createMessage($content, array $records)
    {
        /** @var \Swift_Message $message */
        $message = $this->mailer->createMessage();
        $message->setTo($this->toEmail);
        $message->setFrom($this->fromEmail);
        $message->setSubject($this->subject);

        if ($this->contentType) {
            $message->setContentType($this->contentType);
        }

        return $message;
    }
939805
public function addQuestion(ResourceRecord $resourceRecord): Message
    {
        if (!$resourceRecord->isQuestion()) {
            throw new \InvalidArgumentException('Resource Record provided is not a question.');
        }

        $this->questions[] = $resourceRecord;
        $this->header->setQuestionCount(count($this->questions));

        return $this;
    }
835808
public function getrecord($endtime, $pageindex, $pagesize, $starttime)
    {
        $recond_array = [
            'endtime'   => $endtime,
            'pageindex' => $pageindex,
            'pagesize'  => $pagesize,
            'starttime' => $starttime,
        ];

        $this->apitype = 'customservice';

        $this->module = 'msgrecord';

        $res = $this->_post('getrecord', $recond_array);

        return $res;
    }
135314
public function transformRecords($records)
    {
        if (method_exists($this->class, 'laratablesModifyCollection')) {
            $records = $this->class::laratablesModifyCollection($records)->values();
        }

        return $records->map(function ($item) {
            return $this->transformRecord($item);
        });
    }
290171
public function convert($records)
    {
        if (!is_iterable($records)) {
            throw new TypeError(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($records)));
        }

        if ($this->output_encoding === $this->input_encoding) {
            return $records;
        }

        if (is_array($records)) {
            return array_map($this, $records);
        }

        return new MapIterator($records, $this);
    }
1101559
protected function extractRdata(array $resourceRecord, int $type, string $parent)
    {
        switch ($type) {
            case RecordTypeEnum::TYPE_A:
            case RecordTypeEnum::TYPE_AAAA:
                return $resourceRecord['address'];
            case RecordTypeEnum::TYPE_NS:
            case RecordTypeEnum::TYPE_CNAME:
            case RecordTypeEnum::TYPE_PTR:
                return $this->handleName($resourceRecord['target'], $parent);
            case RecordTypeEnum::TYPE_SOA:
                return [
                    'mname' => $this->handleName($resourceRecord['mname'], $parent),
                    'rname' => $this->handleName($resourceRecord['rname'], $parent),
                    'serial' => $resourceRecord['serial'],
                    'refresh' => $resourceRecord['refresh'],
                    'retry' => $resourceRecord['retry'],
                    'expire' => $resourceRecord['expire'],
                    'minimum' => $resourceRecord['minimum'],
                ];
            case RecordTypeEnum::TYPE_MX:
                return [
                    'preference' => $resourceRecord['preference'],
                    'exchange' => $this->handleName($resourceRecord['exchange'], $parent),
                ];
            case RecordTypeEnum::TYPE_TXT:
                return $resourceRecord['text'];
            case RecordTypeEnum::TYPE_SRV:
                return [
                    'priority' => (int) $resourceRecord['priority'],
                    'weight' => (int) $resourceRecord['weight'],
                    'port' => (int) $resourceRecord['port'],
                    'target' => $this->handleName($resourceRecord['target'], $parent),
                ];
            case RecordTypeEnum::TYPE_AXFR:
            case RecordTypeEnum::TYPE_ANY:
                return '';
            default:
                throw new UnsupportedTypeException(
                    sprintf('Resource Record type "%s" is not a supported type.', RecordTypeEnum::getName($type))
                );
        }
    }
801423
public function formAction($resourceId, User $user)
    {
        $noteManager = $this->getNoteActionManager();
        $notesQB = $noteManager->getNotesForPagination($resourceId, $user);
        $pager = $this->paginateQuery($notesQB, 1);

        return array('resourceId' => $resourceId, 'pager' => $pager);
    }
1219097
public static function addCacheTagsByAddressRecords(array $addressRecords)
    {
        $prefix = 'tt_address_';
        $cacheTags = [];
        foreach ($addressRecords as $addressRecord) {
            if (!$addressRecord instanceof Address) {
                continue;
            }
            // cache tag for each addressRecord record
            $cacheTags[] = $prefix . $addressRecord->getUid();

            if ($addressRecord->_getProperty('_localizedUid') != $addressRecord->getUid()) {
                $cacheTags[] = $prefix . $addressRecord->_getProperty('_localizedUid');
            }
        }

        $GLOBALS['TSFE']->addCacheTags($cacheTags);
    }
649072
public function createMany(array $records, array $properties = array())
    {
        $instances = new Collection;

        foreach ($records as $record)
        {
            $instances->push($this->create($record, $properties));
        }

        return $instances;
    }