@param string $domainName
@param string $recordName

@return int|null
164844
private function fetchDomainId(string $domainName, string $recordName): ?int
    {
        if (!isset($this->domainRecords[$domainName])) {
            $this->domainRecords[$domainName] = $this->domainRecordApi->getAll($domainName);
        }

        foreach ($this->domainRecords[$domainName] as $domainRecord) {
            if ($recordName === $domainRecord->name && Record::TYPE_ADDRESS === $domainRecord->type) {
                return $domainRecord->id;
            }
        }

        return null;
    }
1273013
public function getParameter($instanceName, $paramName) {
		// todo: improve this
		if (isset($this->declaredInstances[$instanceName]['fieldProperties'][$paramName]['value'])) {
			return $this->declaredInstances[$instanceName]['fieldProperties'][$paramName]['value'];
		} else {
			return null;
		}
	}
422289
public function getColumnContent($gridField, $record, $columnName)
    {
        if ($columnName === self::CHECKBOX_COLUMN) {
            return '<input class="multiselect no-change-track" type="checkbox"
					name="' . $columnName . '[' . $record->ID . ']"
					value="' . $record->ID . '">';
        } else {
            return null;
        }
    }
1281751
public function loadDomainCode(string $domainName)
    {
        $domainClassName = DomainActionNameGenerator::getDomainClassName($domainName);

        return $this->load($this->domainsPath . "/" . $domainClassName.".php");
    }
771067
public function getDomain($name)
    {
        if (isset($this->domainMap[$name])) {
            return $this->domainMap[$name];
        }

        return null;
    }
1202120
protected function getDnsRecord($domain)
    {
        if (filter_var($domain, FILTER_VALIDATE_URL) === false) {
            $this->eye->logger()->debug('DNS URL not valid', $domain);
            return false;
        }

        try {
            $dns = $this->pollDns($this->parseUrl($domain));
        } catch (Exception $e) {
            $this->eye->logger()->debug('DNS lookup failed', ['domain' => $domain,
                                                              'exception' => $e->getMessage()]);
            return false;
        }

        return $this->stripTtlFromDns($dns);
    }
830460
public function getCredentialsByService($serviceName)
    {
        if (!in_array($serviceName, $this->getInitializedServices())) {
            throw new DomainException(
                sprintf("Credentials for service '%s' was not initialized", $serviceName)
            );
        }

        return $this->serviceCredentials[$serviceName];
    }
706481
public function setDomainname(string $domainname)
    {
        $this->domainname = $domainname;

        $this->raw = array_merge($this->raw, ['Domainname' => $domainname]);

        return $this;
    }
215956
public function setObjectName($objectName = null)
    {
        return parent::setObjectName(is_null($objectName) ? ( empty($this->getRecordIdent())
                    ? $this->getObjectName() : $this->getRecordIdent().'@'.$this->getObjectName() )
                    : $objectName);
    }
366037
public static function checkDomain($domain_name) {

        if ( $domain_name[0] == '.' ) $domain_name = substr($domain_name, 1);

        return (preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $domain_name) //valid chars check
                && preg_match("/^.{1,253}$/", $domain_name) //overall length check
                && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name)); //length of each label

    }
951455
public function destroyRecord($domain, $recordId)
    {
        return $this->processQuery($this->buildRecordsQuery($domain, $recordId, RecordsActions::ACTION_DESTROY));
    }
1301831
public function countRecords(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collRecordsPartial && !$this->isNew();
        if (null === $this->collRecords || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collRecords) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getRecords());
            }

            $query = RecordQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByPlayer($this)
                ->count($con);
        }

        return count($this->collRecords);
    }
114297
public function getAll($domainName)
    {
        $domainRecords = $this->adapter->get(sprintf('%s/domains/%s/records?per_page=%d', $this->endpoint, $domainName, 200));

        $domainRecords = json_decode($domainRecords);

        $this->extractMeta($domainRecords);

        return array_map(function ($domainRecord) {
            return new DomainRecordEntity($domainRecord);
        }, $domainRecords->domain_records);
    }
245158
public function listDNSRecords($domain)
    {
        $this->returnCode = 'no';
        $data = $this->send('v-list-dns-records', $this->userName, $domain, 'json');
        $data = json_decode($data, true);

        return $data;
    }
1227269
public function iUpdateTheARecordWithTheValue(string $name, string $domain, string $value = null): void
    {
        $parameters = [
            'name' => $name,
            'domain' => $domain,
            '--value' => $value,
            '--adapter' => 'fake',
            '--params' => ['fake'],
        ];

        $input = new ArrayInput(array_filter($parameters));
        $input->setInteractive(false);

        $this->command->run($input, new NullOutput());
    }
636210
public function getSections($domainName): Finder
    {
        if (!in_array($domainName, $this->getDomainNames())) {
            throw new \Exception('Domain not found');
        }

        return (new Finder())
            ->directories()
            ->in(__DIR__.DIRECTORY_SEPARATOR.$domainName)
            ->depth(0)
        ;
    }
1257790
public function domain($domain = null)
    {
        if (func_num_args() === 0) {
            return $this->_data['domain'];
        }
        return $this->_data['domain'] = $domain === null ?  $domain : (string) $domain;
    }