コード例 #1
0
ファイル: DeleteForm.php プロジェクト: eloiv/botafoc.cat
  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->linkitProfile->removeMatcher($this->linkitMatcher);

    drupal_set_message($this->t('The matcher %label has been deleted.', ['%label' => $this->linkitMatcher->getLabel()]));
    $this->logger('linkit')->notice('The matcher %label has been deleted in the @profile profile.', [
      '%label' => $this->linkitMatcher->getLabel(),
      '@profile' => $this->linkitProfile->label(),
    ]);

    $form_state->setRedirect('linkit.matchers', [
      'linkit_profile' => $this->linkitProfile->id(),
    ]);

  }
コード例 #2
0
ファイル: Profile.php プロジェクト: eloiv/botafoc.cat
 /**
  * {@inheritdoc}
  */
 public function removeMatcher(MatcherInterface $matcher) {
   $this->getMatchers()->removeInstanceId($matcher->getUuid());
   $this->save();
   return $this;
 }