/**
  * {@inheritdoc}
  */
 public function save($source, $alias, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED, $pid = null)
 {
     $path = ['source' => $source, 'alias' => $alias, 'language' => $langcode];
     if ($pid) {
         $this->db->merge('url_alias')->key(['pid' => $pid])->fields($path)->execute();
         $this->moduleHandler->invokeAll('path_update', [$path]);
         $path['pid'] = $pid;
     } else {
         $this->db->insert('url_alias')->fields($path)->execute();
         $this->moduleHandler->invokeAll('path_insert', [$path]);
     }
     \Drupal::service('path.alias_manager')->cacheClear($source);
     return $path;
 }
Ejemplo n.º 2
0
 public function merge($table, array $options = array())
 {
     return $this->connection->merge($table, $options);
 }