You are here

public function AttributeDeleteForm::getDescription in Ubercart 8.4

Returns additional text to display as a description.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form description.

Overrides ConfirmFormBase::getDescription

File

uc_attribute/src/Form/AttributeDeleteForm.php, line 31

Class

AttributeDeleteForm
Defines the attribute delete form.

Namespace

Drupal\uc_attribute\Form

Code

public function getDescription() {
  $count = \Drupal::database()
    ->query("SELECT COUNT(*) FROM {uc_product_attributes} WHERE aid = :aid", [
    ':aid' => $this->attribute->aid,
  ])
    ->fetchField();
  return $this
    ->formatPlural($count, 'There is 1 product with this attribute.', 'There are @count products with this attribute.');
}