You are here

protected function AnonymousPublishingClService::isValidationNeeded in Anonymous Publishing 8

Verify that the given entity actually needs validation against anonymous posting.

Parameters

$content: The content to validate.

Return value

bool TRUE if content should be handled, else FALSE.

1 call to AnonymousPublishingClService::isValidationNeeded()
AnonymousPublishingClService::validate in modules/anonymous_publishing_cl/src/Services/AnonymousPublishingClService.php
Common validation of submission form for nodes and comments.

File

modules/anonymous_publishing_cl/src/Services/AnonymousPublishingClService.php, line 206

Class

AnonymousPublishingClService
Helper methods for Anonymous Publishing CL.

Namespace

Drupal\anonymous_publishing_cl\Services

Code

protected function isValidationNeeded($form) {
  if (\Drupal::currentUser()
    ->isAuthenticated()) {
    return FALSE;
  }
  return isset($form['anonymous_publishing']['email']);
}