@param string $zoneId
@param Record $record

@return string|null
170558
private function fetchRecordId(string $zoneId, Record $record)
    {
        $response = $this->dns->list_records($zoneId, $record->getType(), $this->getNormalisedRecordName($record));
        $this->checkResponse($response);

        return $response->result[0]->id ?? null;
    }
951488
public function getLogString(\Imi\Log\Record $record)
    {
        $vars = [
            'message'       => $record->getMessage(),
            'level'         => $record->getLevel(),
            'timestamp'     => $record->getLogTime(),
            'trace'         => $this->parseTrace($record),
        ];

        $find = $replace = [];
        foreach($vars as $key => $value)
        {
            if(is_scalar($value))
            {
                $find[] = '{' . $key . '}';
                $replace[] = $value;
            }
        }
        foreach ($record->getContext() as $key => $value)
        {
            if(is_scalar($value))
            {
                $find[] = '{' . $key . '}';
                $replace[] = $value;
            }
        }
        $logContent = str_replace($find, $replace, $this->format);
        
        return $this->replaceDateTime($logContent, $record->getLogTime());
    }
442563
protected function getValueFromRelation($record, $columnName)
    {
        $fieldNameParts = explode('.', $columnName);
        $tmpItem = clone($record);
        for ($idx = 0; $idx < sizeof($fieldNameParts); $idx++) {
            $methodName = $fieldNameParts[$idx];
            // Last mmethod call from $columnName return what that method is returning
            if ($idx == sizeof($fieldNameParts) - 1) {
                return $tmpItem->XML_val($methodName);
            }
            // else get the object from this $methodName
            $tmpItem = $tmpItem->$methodName();
        }
        return null;
    }
469045
public static ZoneId getZoneId(String zoneId) {
        return JMMap
                .getOrPutGetNew(zoneIdCache, zoneId, () -> ZoneId.of(zoneId));
    }
351246
public function delZoneRecord($zone, $recordid)
    {
        if (!$recordid) {
            throw new \Exception('missing record id');
        }
        // Make sure we know what zone to target
        if (!isset($this->zones[$zone])) {
            throw new \Exception("unknown zone {$zone} did you call getZones()?");
        }
        $uri = $this->baseuri.'/accounts/'.$this->account.'/zones/'.$zone.'/rr/'.$recordid;
        $body = ['comments' => 'automated api delete'];
        $result = $this->httpDelete($uri, $body);

        return $result;
    }
1266899
protected function prepareValue($key, $record)
    {
        $field = $this->fields->first(function (Field $field) use ($key) {
            return in_array($key, (array) $field->column(), true);
        });

        if (method_exists($field, 'prepare')) {
            return $field->prepare($record);
        }

        return $record;
    }
48709
function(record) {
        var i;
        if(record instanceof widget.Record) {
            for(i=0; i<this._records.length; i++) {
                if(this._records[i] && (this._records[i]._sId === record._sId)) {
                    return record;
                }
            }
        }
        else if(lang.isNumber(record)) {
            if((record > -1) && (record < this.getLength())) {
                return this._records[record];
            }
        }
        else if(lang.isString(record)) {
            for(i=0; i<this._records.length; i++) {
                if(this._records[i] && (this._records[i]._sId === record)) {
                    return this._records[i];
                }
            }
        }
        // Not a valid Record for this RecordSet
        return null;

    }
1111613
def delete_records(self, zone_name, record_type, subdomain):
        
        records = self._client.get('/domain/zone/{}/record'.format(zone_name),
                                   fieldType=record_type, subDomain=subdomain)
        for record in records:
            self.delete_record(zone_name, record)
551248
protected function fetchRecords($zone)
    {
        if (!$zone) {
            throw new \Exception('fetchRecords called with blank zone');
        }
        $uri = $this->baseuri.'/accounts/'.$this->account.'/zones/'.$zone.'/rr';
        $result = $this->httpGet($uri);

        return $result;
    }
653755
protected function getRecordVersion($recordClass, $recordId, $recordVersion)
    {
        $record = Versioned::get_version($recordClass, $recordId, $recordVersion);

        if (!$record) {
            $this->jsonError(404);
            return null;
        }

        if (!$record->canView()) {
            $this->jsonError(403, _t(
                __CLASS__.'.ErrorItemViewPermissionDenied',
                "You don't have the necessary permissions to view {ObjectTitle}",
                ['ObjectTitle' => $record->i18n_singular_name()]
            ));
            return null;
        }

        return $record;
    }
1323304
protected function getZoneToGeoZones($geo_zone_id)
    {
        static $geoZonesCache = array();

        if (!isset($geoZonesCache[$geo_zone_id])) {
            /** @noinspection SqlResolve */
            $query = $this->getRegistry()->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int) $geo_zone_id . "'");
            $geoZonesCache[$geo_zone_id] = $query->rows;
        }
        return $geoZonesCache[$geo_zone_id];
    }
1213448
def _list_records_in_zone(self, zone, rdtype=None, name=None, content=None):
        
        records = []
        rrsets = zone.iterate_rdatasets() if zone else []
        for rname, rdataset in rrsets:
            rtype = dns.rdatatype.to_text(rdataset.rdtype)
            if ((not rdtype or rdtype == rtype)
                    and (not name or name == rname.to_text())):
                for rdata in rdataset:
                    rdata = rdata.to_text()
                    if not content or self._convert_content(rtype, content) == rdata:
                        raw_rdata = self._clean_TXT_record({'type': rtype,
                                                            'content': rdata})['content']
                        data = {
                            'type': rtype,
                            'name': rname.to_text(True),
                            'ttl': int(rdataset.ttl),
                            'content': raw_rdata,
                            'id': Provider._create_identifier(rtype, rname.to_text(), raw_rdata)
                        }
                        records.append(data)
        return records
256265
public function getSelector($pkey, array $record)
    {
        if ($pkey !== null && !is_array($pkey))
            throw new InvalidTypeException("Invalid primary key: " . WF::str($pkey));

        // When no primary key is available, we match on all fields
        $is_primary_key = true;
        if ($pkey === null)
        {
            $pkey = array();
            foreach ($record as $k => $v)
                $pkey[$k] = $this->table->getColumn($v);
            $is_primary_key = false;
        }

        // Make sure there are fields to match on
        if (empty($pkey))
            throw new InvalidTypeException("No fields to match on");

        $condition = null;
        foreach ($pkey as $pkey_column => $coldef)
        {
            if ($is_primary_key && (!array_key_exists($pkey_column, $record) || $record[$pkey_column] === null))
                throw new DAOException("Record does not have value for primary key column {$pkey_column}");
            
            $pkey_value = $coldef->beforeInsertFilter($record[$pkey_column]);
            $comparator = new Query\ComparisonOperator("=", $pkey_column, $pkey_value);
            $condition = $condition === null ? $comparator : new Query\BooleanOperator("AND", $condition, $comparator);
        }

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

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

        return $this->buildRequest();
    }
23572
protected function getSpecsMarkup($record)
    {
        if (!$record || !$record->exists()) {
            return null;
        }
        return sprintf(
            '<div class="editor__specs">%s %s</div>',
            $record->getSize(),
            $this->getStatusFlagMarkup($record)
        );
    }
652208
public function get($zone_id)
    {
        $result = null;
        $this->hook->attach('zone.get.before', $zone_id, $result, $this);

        if (isset($result)) {
            return $result;
        }

        $result = $this->db->fetch('SELECT * FROM zone WHERE zone_id=?', array($zone_id));
        $this->hook->attach('zone.get.after', $zone_id, $result, $this);
        return $result;
    }
1331869
protected function fetchRecords($zone)
    {
        if (!$zone) {
            throw new \Exception('fetchRecords called with blank zone');
        }
        /* Sample get zone info call
            <urn2:getZoneInfo_V2>
                <!--You may enter ANY elements at this point-->
                <urn2:domainName>test.com</urn2:domainName>
            </urn2:getZoneInfo_V2>
        */
        $response = $this->soapCall('getZoneInfo_V2', ['domainName' => $zone]);
        if (!$response['callSuccess']) {
            throw new \Exception('SOAP callSuccess false');
        }
        $this->zones[$zone] = $response['primaryZoneInfo'];

        return $response['primaryZoneInfo']['resourceRecord'];
    }