delete example

if (empty($id)) {
            return ['success' => false, 'error' => 'The id parameter contains no value.'];
        }

        $model = $this->getManager()->find($this->model, $id);

        if (!($model instanceof $this->model)) {
            return ['success' => false, 'error' => 'The passed id parameter exists no more.'];
        }

        try {
            $this->addressService->delete($model);
        } catch (\Exception $ex) {
            return ['success' => false, 'error' => $ex->getMessage()];
        }

        return ['success' => true];
    }

    /** * {@inheritdoc} */
    protected function getListQuery()
    {
if ($entity) {
            $this->entityManager->remove($entity);
            $this->entityManager->flush($entity);
        }

        if (!$updateDependingTables) {
            return;
        }

        $dependingTables = $this->tableMapping->getDependingTables($table);
        foreach ($dependingTables as $dependingTable) {
            $this->delete($dependingTable$column);
        }
    }

    /** * {@inheritdoc} */
    public function update(
        $table,
        $columnName,
        $unifiedType,
        array $data = [],
        
$this->drupalLogin($this->adminUser);

    // Add a new block of this type.     $block = $this->createBlockContent(FALSE, 'foo');
    // Attempt to delete the block type, which should not be allowed.     $this->drupalGet('admin/structure/block-content/manage/' . $type->id() . '/delete');
    $this->assertSession()->pageTextContains($type->label() . ' is used by 1 content block on your site. You can not remove this block type until you have removed all of the ' . $type->label() . ' blocks.');
    $this->assertSession()->pageTextNotContains('This action cannot be undone.');

    // Delete the block.     $block->delete();
    // Attempt to delete the block type, which should now be allowed.     $this->drupalGet('admin/structure/block-content/manage/' . $type->id() . '/delete');
    $this->assertSession()->pageTextContains('Are you sure you want to delete the block type ' . $type->id() . '?');
    $this->assertSession()->pageTextContains('This action cannot be undone.');
  }

  /** * Tests that redirects work as expected when multiple block types exist. */
  public function testsBlockContentAddTypes() {
    // Now create an initial block-type.

    }

    private function addTestConditions(): void
    {
        $this->connection->insert('rule', $this->testRule);
        $this->connection->insert('rule_condition', $this->testCondition);
    }

    private function removeTestConditions(): void
    {
        $this->connection->delete('rule_condition', [
            'id' => $this->testCondition['id'],
        ]);
        $this->connection->delete('rule', [
            'id' => $this->testRule['id'],
        ]);
    }
}
if ($data = $this->cache->get($key)) {
            return false;
        }

        Factories::setComponentInstances($component$data);

        return true;
    }

    public function delete(string $component): void
    {
        $this->cache->delete($this->getCacheKey($component));
    }
}

    }

    private function deleteOldScripts(ScriptCollection $toBeRemoved, Context $context): void
    {
        /** @var array<string> $ids */
        $ids = $toBeRemoved->getIds();

        if (!empty($ids)) {
            $ids = array_map(static fn (string $id): array => ['id' => $id]array_values($ids));

            $this->scriptRepository->delete($ids$context);
        }
    }

    private function getAppWithExistingScripts(string $appId, Context $context): AppEntity
    {
        $criteria = new Criteria([$appId]);
        $criteria->addAssociation('scripts');

        /** @var AppEntity $app */
        $app = $this->appRepository->search($criteria$context)->first();

        

    }
    return $current_words;
  }

  /** * {@inheritdoc} */
  public function clear($type = NULL, $sid = NULL, $langcode = NULL) {

    try {
      $query_index = $this->connection->delete('search_index');
      $query_dataset = $this->connection->delete('search_dataset');
      if ($type) {
        $query_index->condition('type', $type);
        $query_dataset->condition('type', $type);
        if ($sid) {
          $query_index->condition('sid', $sid);
          $query_dataset->condition('sid', $sid);
          if ($langcode) {
            $query_index->condition('langcode', $langcode);
            $query_dataset->condition('langcode', $langcode);
          }
        }
$alias_manager->cacheClear($path_alias->getPath())->shouldBeCalledTimes(1);
    $alias_manager->cacheClear($new_source)->shouldBeCalledTimes(1);
    \Drupal::getContainer()->set('path_alias.manager', $alias_manager->reveal());
    $path_alias->setPath($new_source);
    $path_alias->save();

    // Check \Drupal\path_alias\Entity\PathAlias::postDelete().     $alias_manager = $this->prophesize(AliasManagerInterface::class);
    $alias_manager->cacheClear(Argument::any())->shouldBeCalledTimes(1);
    $alias_manager->cacheClear($new_source)->shouldBeCalledTimes(1);
    \Drupal::getContainer()->set('path_alias.manager', $alias_manager->reveal());
    $path_alias->delete();
  }

}
$query->setParameter(':names', $names, Connection::PARAM_STR_ARRAY);
        $query->setParameter(':pluginId', $plugin->getId());

        $ids = $query->execute()->fetchAll(PDO::FETCH_COLUMN);

        if (empty($ids)) {
            return;
        }

        // elements         $query = $this->em->getConnection()->createQueryBuilder();
        $query->delete('s_core_config_elements');
        $query->where('id IN (:ids)');
        $query->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);
        $query->execute();

        // saved values         $query = $this->em->getConnection()->createQueryBuilder();
        $query->delete('s_core_config_values');
        $query->where('element_id IN (:ids)');
        $query->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);
        $query->execute();

        
$this->sectionStorage = $section_storage;
    // Mark this as an administrative page for JavaScript ("Back to site" link).     $form['#attached']['drupalSettings']['path']['currentPathIsAdmin'] = TRUE;
    return parent::buildForm($form$form_state);
  }

  /** * {@inheritdoc} */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->sectionStorage->disableLayoutBuilder()->save();
    $this->layoutTempstoreRepository->delete($this->sectionStorage);

    $this->messenger()->addMessage($this->t('Layout Builder has been disabled.'));
    $form_state->setRedirectUrl($this->getCancelUrl());
  }

}
if ($is_changed) {
        // Only update or insert if we have a value to use.         $target = $existing_translation_objects[$lid] ?? $this->localeStorage->createTranslation(['lid' => $lid, 'language' => $langcode]);
        $target->setPlurals($new_translation['translations'])
          ->setCustomized()
          ->save();
        $updated[] = $target->getId();
      }
      if (empty($new_translation_string) && isset($existing_translation_objects[$lid])) {
        // Empty new translation entered: remove existing entry from database.         $existing_translation_objects[$lid]->delete();
        $updated[] = $lid;
      }
    }

    $this->messenger()->addStatus($this->t('The strings have been saved.'));

    // Keep the user on the current pager page.     $page = $this->getRequest()->query->get('page');
    if (isset($page)) {
      $form_state->setRedirect(
        'locale.translate_page',
        [],
$this->deleteOldActions($existingActionButtons$context);
    }

    private function deleteOldActions(ActionButtonCollection $toBeRemoved, Context $context): void
    {
        /** @var array<string> $ids */
        $ids = $toBeRemoved->getIds();

        if (!empty($ids)) {
            $ids = array_map(static fn (string $id): array => ['id' => $id]array_values($ids));

            $this->actionButtonRepository->delete($ids$context);
        }
    }

    private function getExistingActionButtons(string $appId, Context $context): ActionButtonCollection
    {
        $criteria = new Criteria();
        $criteria->addFilter(new EqualsFilter('appId', $appId));

        /** @var ActionButtonCollection $actionButtons */
        $actionButtons = $this->actionButtonRepository->search($criteria$context)->getEntities();

        
$token,
            $jwtToken->claims()->get('pmi'),
            $jwtToken->claims()->get('sub'),
            $jwtToken->claims()->get('ful'),
            $expires->getTimestamp(),
            $errorUrl
        );
    }

    public function invalidateToken(string $token): bool
    {
        $this->delete($token);

        return false;
    }

    private function write(string $token, \DateTimeImmutable $expires): void
    {
        $this->connection->insert('payment_token', [
            'token' => self::normalize($token),
            'expires' => $expires->format(Defaults::STORAGE_DATE_TIME_FORMAT),
        ]);
    }

    

  public function set(SectionStorageInterface $section_storage) {
    $key = $this->getKey($section_storage);
    $this->getTempstore($section_storage)->set($key['section_storage' => $section_storage]);
  }

  /** * {@inheritdoc} */
  public function delete(SectionStorageInterface $section_storage) {
    $key = $this->getKey($section_storage);
    $this->getTempstore($section_storage)->delete($key);
  }

  /** * Gets the shared tempstore. * * @param \Drupal\layout_builder\SectionStorageInterface $section_storage * The section storage. * * @return \Drupal\Core\TempStore\SharedTempStore * The tempstore. */
  


  /** * {@inheritdoc} */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $field_storage = $this->entity->getFieldStorageDefinition();
    $bundles = $this->entityTypeBundleInfo->getBundleInfo($this->entity->getTargetEntityTypeId());
    $bundle_label = $bundles[$this->entity->getTargetBundle()]['label'];

    if ($field_storage && !$field_storage->isLocked()) {
      $this->entity->delete();
      $this->messenger()->addStatus($this->t('The field %field has been deleted from the %type content type.', ['%field' => $this->entity->label(), '%type' => $bundle_label]));
    }
    else {
      $this->messenger()->addError($this->t('There was a problem removing the %field from the %type content type.', ['%field' => $this->entity->label(), '%type' => $bundle_label]));
    }

    $form_state->setRedirectUrl($this->getCancelUrl());

    // Fields are purged on cron. However field module prevents disabling modules     // when field types they provided are used in a field until it is fully     // purged. In the case that a field has minimal or no content, a single call
Home | Imprint | This part of the site doesn't use cookies.