Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function createDomain(array $values = array())
 {
     $default = $this->loader->loadDefaultId();
     $domains = $this->loader->loadMultiple();
     if (empty($values)) {
         $values['hostname'] = $this->createHostname();
         $values['name'] = \Drupal::config('system.site')->get('name');
         $values['id'] = $this->createMachineName($values['hostname']);
     }
     $values += array('scheme' => empty($GLOBALS['is_https']) ? 'http' : 'https', 'status' => 1, 'weight' => count($domains) + 1, 'is_default' => (int) empty($default));
     $domain = \Drupal::entityManager()->getStorage('domain')->create($values);
     return $domain;
 }