/** * Transform zone to file * * @return string * @throws \Jeboehm\Lampcp\ZoneGeneratorBundle\Exception\NoSoaRecord * @throws \Jeboehm\Lampcp\ZoneGeneratorBundle\Exception\NSNotFound * @throws \Jeboehm\Lampcp\ZoneGeneratorBundle\Exception\NoResourceRecords */ public function transform() { $ns_origin = false; if (!$this->_collection->getSoa()) { throw new NoSoaRecord(); } if ($this->_collection->count() < 1) { throw new NoResourceRecords(); } foreach ($this->_collection->getByType('NS') as $rr) { if ($rr->getName() == '@') { $ns_origin = true; } } if (!$ns_origin) { throw new NSNotFound(); } return $this->_createZone(); }