function __construct(Domain $domainLibrary)
 {
     parent::__construct('mail_domain');
     $this->setVariable('domain_name', $domainLibrary->getDomainName());
     $this->setVariable('description', $domainLibrary->getDescription());
     $this->setVariable('last_modified', $domainLibrary->lastModified());
     $this->setVariable('address_library', $domainLibrary->getAddressLibrary());
     $this->setVariable('alias_target', $domainLibrary->isAliasDomain() ? $domainLibrary->getAliasTarget()->getDomainName() : null);
     $this->setVariable('active', $domainLibrary->isActive());
 }
 /**
  * Check if the instance is in the library.
  * @param \ChristianBudde\Part\model\mail\Domain $domain
  * @return bool
  */
 public function containsDomain(Domain $domain)
 {
     return isset($this->listDomains[$d = $domain->getDomainName()]) && $this->listDomains[$d] === $domain;
 }