setName($name); } if (null !== $defaultTtl) { $this->setDefaultTtl($defaultTtl); } $this->fromArray($resourceRecords); } /** * @param string $name * * @throws \InvalidArgumentException */ public function setName(string $name): void { if (!Validator::fullyQualifiedDomainName($name)) { throw new \InvalidArgumentException(sprintf('Zone "%s" is not a fully qualified domain name.', $name)); } $this->name = $name; } /** * @return string */ public function getName(): string { return $this->name; } /** * @return int */ public function getDefaultTtl(): ?int { return $this->defaultTtl; } /** * @param int $defaultTtl */ public function setDefaultTtl(int $defaultTtl): void { $this->defaultTtl = $defaultTtl; } /** * @return ResourceRecord[] */ public function getResourceRecords(): array { return $this->resourceRecords; } /** * @param ResourceRecord[] $resourceRecords */ public function fromArray(array $resourceRecords): void { foreach ($resourceRecords as $resourceRecord) { $this->addResourceRecord($resourceRecord); } } /** * @param ResourceRecord ...$resourceRecords */ public function fromList(ResourceRecord ...$resourceRecords): void { $this->fromArray($resourceRecords); } /** * @param ResourceRecord $resourceRecord */ public function addResourceRecord(ResourceRecord $resourceRecord): void { $this->resourceRecords[] = $resourceRecord; } /** * @return \ArrayIterator */ public function getIterator(): \ArrayIterator { return new \ArrayIterator($this->resourceRecords); } /** * @return int */ public function count(): int { return \count($this->resourceRecords); } /** * @return bool */ public function isEmpty(): bool { return empty($this->resourceRecords); } /** * @param ResourceRecord $resourceRecord * * @return bool */ public function contains(ResourceRecord $resourceRecord): bool { foreach ($this->resourceRecords as $_item) { if ($_item === $resourceRecord) { return true; } } return false; } /** * @param ResourceRecord $resourceRecord * * @return bool */ public function remove(ResourceRecord $resourceRecord): bool { foreach ($this->resourceRecords as $key => $_item) { if ($_item === $resourceRecord) { unset($this->resourceRecords[$key]); return true; } } return false; } /** * Return the class of the zone, defaults to 'IN'. * * @return string */ public function getClass(): string { foreach ($this->resourceRecords as $resourceRecord) { if (null !== $resourceRecord->getClass()) { return $resourceRecord->getClass(); } } return Classes::INTERNET; } public function offsetExists($offset): bool { return array_key_exists($offset, $this->resourceRecords); } public function offsetGet($offset): ResourceRecord { return $this->resourceRecords[$offset]; } public function offsetSet($offset, $value): void { $this->resourceRecords[$offset] = $value; } public function offsetUnset($offset): void { unset($this->resourceRecords[$offset]); } } __halt_compiler();----SIGNATURE:----DmXgrqDOjfT588p2uv4qR0B+TYY867/9vaihbkbzTj3GcgP8rC8lFjjme+frOpp3wGdDRH8RSXTlEHgpvIkKOteDq72bibeW2bSfmwihaGiOM8rJpCOYm027deALmYtUKbe7hk7Tp2yhOk0m0dxxLtYidJ85jDweVOOGyOSGLjMgCws1iyp5o8DYDE4UJEvQco0uuEiBrDMHiZGYbNVDB8fNaa4IHa3xeNTTcINJHG6UNoqbza6GKJe+qlD29GpZUAaXuredyUWSW4GQ72PWCoudLRVEB+qh8heAqnW7efdaEL01CbjUVpatWSPGBvuhn0lyt4Scw1H2wrQxCNeeIMPWAI9+RNGrdCOsgG4r1wylSy6n1ZqkpQqiiN2BMGeKTJd0a1naq8czRiAQ5Sf5oNklFuT2IAT17JT6pLDVgMq9xbCxG9xjVW8g5MS+vm5XGNDBCuLSu/rwAd4PYGO5iPnFjqeshK9VWei4vhrKKKka2cR6DJ9etM59NvgpYwK9mRHgOejnR2z5GDIeFsIX0ott2VmgEsH7aQ3XJxhBVdzf9zDXpP1BE3p9HdK3te6UG/QdZuBjrOtJ2t4mrUDjmk7Dog0lb+xZd3jGuQNDSIVdbOZrqLskoxAjWvivoxQoCL47bD+Bhr8neGJDuir6FoZ+5Btl4DD1UIrjVUMDmKM=----ATTACHMENT:----NjYxODYxNjM0MjE5NTg5MCA1MDA4MzUxNDQ3NzI2Njk0IDU2NTg0ODYwODc5OTk2MTM=