ZoneTemplateWriteService
class ZoneTemplateWriteService (View source)
Creating, editing and deleting zone templates, saving a zone as a template, and the system-wide default template. Writes report their outcome instead of flashing it.
Methods
No description
Resolve the system-wide default zone template
Mark a template as the system-wide default. Clears is_default from all
other templates so only one is flagged at a time. Personal templates
(owner != 0) cannot be marked default.
Clear the system-wide default zone template flag.
Add a zone template
Modify zone template
Delete a zone template
Add a zone template from zone / another template
Details
__construct(ZoneTemplateRepositoryInterface $repository, ZoneTemplateAccessPolicy $access, ConfigurationInterface $config, LoggerInterface $logger, ZoneTemplatePlaceholders $placeholders)
No description
int|null
getDefaultTemplateId()
Resolve the system-wide default zone template
Resolution order:
- The template with
is_default = 1(global only,owner = 0) - The
dns.default_zone_templateconfig setting (id or name) - null (no default; the form falls back to "none")
Names that resolve to multiple templates cause the config setting to be skipped with a warning logged - operators must use the id or rename one of the duplicates.
ZoneTemplateWriteResult
setDefaultTemplate(int $zone_templ_id)
Mark a template as the system-wide default. Clears is_default from all
other templates so only one is flagged at a time. Personal templates
(owner != 0) cannot be marked default.
ZoneTemplateWriteResult
unsetDefaultTemplate()
Clear the system-wide default zone template flag.
ZoneTemplateWriteResult
addZoneTempl(array $details, int $userid, array $groupIds = [])
Add a zone template
ZoneTemplateWriteResult
editZoneTempl(array $details, int $zone_templ_id, int $user_id)
Modify zone template
ZoneTemplateWriteResult
deleteZoneTempl(int $zone_templ_id)
Delete a zone template
ZoneTemplateWriteResult
addZoneTemplSaveAs(string $template_name, string $description, int $userid, array $records, array $options, string $domain = '')
Add a zone template from zone / another template