zone = $zone; } private function removePTRs() { foreach(Repository::factory()->byZone($this->zone)->get() as $reverse) { $helper = new ReverseDNS($reverse); $zone = new Zone(); $zone->name = $reverse->name; $zone->serverid = $reverse->serverid; $module = $zone->getModule(); $helper->remove(); if($module->zoneExists() && count($module->getRDNSRecord($reverse->ip)) <= 1 && GlobalSettingHelper::getSetting(GlobalSettingEnum::DO_NOT_REMOVE_EMPTY_PTR_ZONES) !== 'on' ) { $module->terminateZone(); } } } /** * Usuwanie zona oraz jego rDNS z serwera i bazy */ public function remove() { $this->removePTRs(); $module = $this->zone->getModule(); if ($module->zoneExists()) $module->terminateZone(); $this->zone->delete(); $clientID = explode("|", $this->zone->clientid)[0]; // LogHelper::addSuccessLog('Remove Zone', '', $this->zone->name, $clientID); EmailNotificationHelper::sendClientNotification(DefaultNotifications::GENERAL_ZONE_REMOVED_NOTIFICATION, $clientID, $this->item->type, $this->item->relid, array( 'zone_name' => $this->zone->name, )); } /** * Jednolinijkowe usuwanie zona * @param mixed $zone nazwa zona lub model z bazy */ public static function removeZone($zone) { $remover = new self($zone); $remover->remove(); } }