You are here

public function ReCaptchaV3ActionListBuilder::buildRow in reCAPTCHA v3 8

Builds a row for an entity in the entity listing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.

Return value

array A render array structure of fields for this entity.

Overrides EntityListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/ReCaptchaV3ActionListBuilder.php, line 35

Class

ReCaptchaV3ActionListBuilder
Provides a listing of reCAPTCHA v3 action entities.

Namespace

Drupal\recaptcha_v3

Code

public function buildRow(EntityInterface $entity) {

  /** @var \Drupal\recaptcha_v3\ReCaptchaV3ActionInterface $entity */
  $row['label'] = $entity
    ->label();
  $row['id'] = $entity
    ->id();
  $row['threshold'] = $entity
    ->getThreshold();
  $challenge_type = $entity
    ->getChallenge();
  $row['challenge'] = $this
    ->getCaptchaChallengeTypes()[$challenge_type] ?? $this
    ->t('Not defined');
  return $row + parent::buildRow($entity);
}